config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadConfigFile

func ReadConfigFile(cfg *Config, path string)

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

func ReadEnvironment

func ReadEnvironment(cfg *Config)

ReadEnvironment overrides any configs set with settings from the environment

Types

type Config

type Config struct {
	// Server settings
	Address string `yaml:"address" envconfig:"address"`
	Port    int    `yaml:"port" envconfig:"port"`

	// Logger settings
	LogLevel  string `yaml:"loglevel" envconfig:"loglevel"`
	LogFormat string `yaml:"logformat" envconfig:"logformat"`

	// CrawlInterval in seconds
	CrawlInterval int `yaml:"crawl_interval" envconfig:"crawlinterval"`

	// AWS settings
	AWSRegion string `yaml:"aws_region" envconfig:"awsregion"`

	// Service settings
	// - Owner of the service. For example the team running it.
	//   Defaulted to the current user.
	Owner string `yaml:"owner" envconfig:"owner"`
}

Config struct holds the current configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a Config struct with default values

func Initialize

func Initialize() *Config

Initialize a new Config

Jump to

Keyboard shortcuts

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