config

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package config provides types and handling for configuration values used in the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	IndentationSize uint
	PreferredSource string
	// contains filtered or unexported fields
}

Configuration defines the application's configuration structure

func NewFromRuntime

func NewFromRuntime(
	flags *flag.FlagSet,
	providerConfigs map[string]registry.Configuration,
	defaultConfigFileLocation string,
	defaults Configuration,
) (Configuration, error)

NewFromRuntime builds a Configuration by merging values from multiple different sources. It accepts a Configuration containing default values to fill in any empty/blank configuration values found when merging from the different sources.

The merging of values from different sources will take this priority: 1. Command line arguments 2. A loaded config file, if available 3. Environment variables 4. Passed in default values

func (Configuration) MarshalJSON

func (c Configuration) MarshalJSON() ([]byte, error)

MarshalJSON defines how the configuration should be JSON marshalled.

func (Configuration) ProviderConfigs

func (c Configuration) ProviderConfigs() []registry.Configuration

ProviderConfigs returns the configurations of the source providers.

func (*Configuration) UnmarshalJSON

func (c *Configuration) UnmarshalJSON(data []byte) error

UnmarshalJSON defines how the configuration should be JSON unmarshalled.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL