Documentation ¶
Index ¶
- Variables
- type Module
- func (m *Module) Getenv(key string) string
- func (m *Module) Init(c *service.Config)
- func (m *Module) LoadConfig(path string) error
- func (m *Module) PrintConsolidatedConfig()
- func (m *Module) ReadConfig(i interface{}) error
- func (m *Module) Resource(resource string) ([]byte, error)
- func (m *Module) ResourcePath(resource string) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfigEnv = "CONFIG_FILE"
ConfigEnv specifies the env variable which contains the path to a config file. To use a different env variable, change this in an init block in your app.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct { Logger *logger.Module Byte []byte Env map[string]string ConfigPath string // TestConfigPath can be to load a specific config file in tests. // Alternatively, you can set Byte directly to the desired config // file contents. TestConfigPath string DisableChdir bool // contains filtered or unexported fields }
Module for config package.
func (*Module) LoadConfig ¶
LoadConfig loads the config json file from the given path
func (*Module) PrintConsolidatedConfig ¶
func (m *Module) PrintConsolidatedConfig()
PrintConsolidatedConfig prints out the definitions of all config
func (*Module) ReadConfig ¶
ReadConfig json-decodes the config file bytes into i, which should be a pointer to a struct.
Click to show internal directories.
Click to hide internal directories.