Documentation
¶
Index ¶
- Constants
- Variables
- type AbstractContainer
- type Config
- func (c *Config) GetAppEnv() string
- func (c *Config) GetBool(key string) bool
- func (c *Config) GetDuration(key string) time.Duration
- func (c *Config) GetInt(key string) int
- func (c *Config) GetServiceName() string
- func (c *Config) GetStorage() *viper.Viper
- func (c *Config) GetString(key string) string
- func (c *Config) GetStringOrDefault(key, defaultValue string) string
- func (c *Config) GetStringSlice(key string) []string
- func (c *Config) WatchBool(key string) func() bool
- func (c *Config) WatchDuration(key string) func() time.Duration
- func (c *Config) WatchInt(key string) func() int
- func (c *Config) WatchString(key string) func() string
- func (c *Config) WatchStringSlice(key string) func() []string
- type Container
- type ServiceContainer
- type ServiceOpts
Constants ¶
View Source
const AppEnvDev = "dev"
Variables ¶
View Source
var ( ErrEmptyConfigPaths = errors.New("config paths is set but empty after parsing") ErrNoConfigPathSet = errors.New("neither config.file.paths nor config.file.path is set") ErrEtcdEndpointRequired = errors.New("etcd endpoint is required when using etcd") ErrEmptyEtcdStaticPaths = errors.New("etcd static paths is set but empty after parsing") ErrEmptyEtcdDynamicPaths = errors.New("etcd dynamic paths is set but empty after parsing") )
Functions ¶
This section is empty.
Types ¶
type AbstractContainer ¶
type AbstractContainer[C config, S serviceContainer] interface {
GetConfig() *C
GetServices() *S
}
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func (*Config) GetServiceName ¶
func (*Config) GetStorage ¶
func (*Config) GetStringOrDefault ¶
func (*Config) GetStringSlice ¶
func (*Config) WatchString ¶
func (*Config) WatchStringSlice ¶
type Container ¶
type Container[C config, S serviceContainer] struct {
// contains filtered or unexported fields
}
func NewContainer ¶
func (*Container[C, S]) GetServices ¶
func (c *Container[C, S]) GetServices() S
type ServiceContainer ¶
type ServiceContainer struct {
// contains filtered or unexported fields
}
func NewServiceContainer ¶
func NewServiceContainer() *ServiceContainer
func (*ServiceContainer) AddOnClose ¶
func (s *ServiceContainer) AddOnClose(callback func() error)
type ServiceOpts ¶
type ServiceOpts[S serviceContainer] func(*S)
Click to show internal directories.
Click to hide internal directories.