Documentation ¶
Index ¶
- func AllServices() map[string]ServiceConfig
- func DatabasePath() string
- func DefaultConfigDir() string
- func InitConfig(cfgFile string) error
- func ValidateKey(key string) error
- func WriteConfig(removedKeys ...string) error
- type ServiceConfig
- func (c *ServiceConfig) Delete() error
- func (c *ServiceConfig) GetBool(key string, defaultValue bool) bool
- func (c *ServiceConfig) GetInt(key string, defaultValue int) int
- func (c *ServiceConfig) GetString(key string) string
- func (c *ServiceConfig) IsSet(key string) bool
- func (c *ServiceConfig) Save() error
- func (c ServiceConfig) String() string
- type ServiceList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllServices ¶
func AllServices() map[string]ServiceConfig
func DatabasePath ¶
func DatabasePath() string
func DefaultConfigDir ¶
func DefaultConfigDir() string
func InitConfig ¶
initConfig reads in config file and ENV variables if set.
func ValidateKey ¶
func WriteConfig ¶
Write the configuration except for removedKeys
Types ¶
type ServiceConfig ¶
func GetService ¶
func GetService(name string) (ServiceConfig, error)
func NewServiceConfig ¶
func NewServiceConfig(name string, config *viper.Viper) ServiceConfig
func (*ServiceConfig) Delete ¶
func (c *ServiceConfig) Delete() error
Deletes the service configuration from the config file
func (*ServiceConfig) GetInt ¶ added in v0.4.0
func (c *ServiceConfig) GetInt(key string, defaultValue int) int
func (*ServiceConfig) GetString ¶
func (c *ServiceConfig) GetString(key string) string
func (*ServiceConfig) IsSet ¶
func (c *ServiceConfig) IsSet(key string) bool
func (*ServiceConfig) Save ¶
func (c *ServiceConfig) Save() error
func (ServiceConfig) String ¶
func (c ServiceConfig) String() string
type ServiceList ¶
type ServiceList []ServiceConfig
func AllServicesAsList ¶
func AllServicesAsList() ServiceList
func (ServiceList) Len ¶
func (l ServiceList) Len() int
func (ServiceList) Less ¶
func (l ServiceList) Less(i, j int) bool
func (ServiceList) Swap ¶
func (l ServiceList) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.