config

package
v0.0.0-...-dca6c44 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigFilePath

func GetConfigFilePath(override string) string

GetConfigFilePath returns the location of the config file in order of priority: 1 ) Specified by --config command-line flag 2 ) Global file in /etc/fusion/fusion.yml

func ReadConfigFile

func ReadConfigFile(conf *Config, path string) error

ReadConfigFile reads the config file and overrides any values net in both it and the DefaultConfig

func ReadEnvironment

func ReadEnvironment(conf *Config)

ReadEnvironment takes environment variables and overrides any values from DefaultConfig and the Config file.

Types

type Config

type Config struct {
	// Logging
	LogLevel  string `yaml:"loglevel"`
	LogFormat string `yaml:"logformat"`

	// Server
	Address string `yaml:"address"`
	Port    int16  `yaml:"port"`

	// Database
	Database DatabaseConfig `yaml:"database"`
}

The Config struct holds the Fusion Configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a Config struct with the default settings

type DatabaseConfig

type DatabaseConfig struct {
	Host     string `envconfig:"database_host"`
	Port     int16  `envconfig:"database_port"`
	Name     string `envconfig:"database_name"`
	User     string `envconnfig:"database_user"`
	Password string `envconnfig:"database_password"`
}

DatabaseConfig object

Jump to

Keyboard shortcuts

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