Documentation
¶
Index ¶
- type ConfigEnv
- type Container
- func (c *Container) CheckHealth(ctx context.Context) []*healthy.Error
- func (c *Container) Close() error
- func (c *Container) CloseWithContext(ctx context.Context) error
- func (c *Container) LoadConfig(dir string, env ConfigEnv) error
- func (c *Container) OnClose(closer func() error)
- func (c *Container) OnHealthCheck(checker func() *healthy.Error)
- func (c *Container) RunHealthCheck(ticker, timeout time.Duration, handler func(errs []*healthy.Error))
- func (c *Container) UnmarshalAndWatchConfig(name string, defaultContent []byte, handler func(v *viper.Viper)) error
- func (c *Container) UnmarshalConfig(name string, v any, defaultContent []byte) error
- func (c *Container) WatchConfig(name string, handler func(v *viper.Viper)) error
- type MultiError
- type Provider
- func (f *Provider[T]) Get(c *Container) (t T, err error)
- func (f *Provider[T]) GetNew(c *Container) (T, error)
- func (f *Provider[T]) IsSet(c *Container) bool
- func (f *Provider[T]) MustGet(c *Container) T
- func (f *Provider[T]) MustGetNew(c *Container) T
- func (f *Provider[T]) MustRefresh(c *Container) T
- func (f *Provider[T]) Refresh(c *Container) (ins T, err error)
- func (f *Provider[T]) Set(c *Container, ins T)
- type Providers
- type Vipers
- func (c *Vipers) GetOrCreateViper(name string, defaultContent []byte) (*viper.Viper, error)
- func (c *Vipers) Unmarshal(name string, v any, def []byte) error
- func (c *Vipers) UnmarshalAndWatch(name string, defaultContent []byte, callback func(v *viper.Viper)) error
- func (c *Vipers) WatchConfig(name string, callback func(v *viper.Viper)) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func NewContainer ¶
func NewContainer() *Container
func (*Container) CheckHealth ¶
func (*Container) CloseWithContext ¶
func (*Container) OnHealthCheck ¶
func (*Container) RunHealthCheck ¶
func (*Container) UnmarshalAndWatchConfig ¶
func (*Container) UnmarshalConfig ¶
type MultiError ¶
type MultiError []error
func (MultiError) Error ¶
func (m MultiError) Error() string
type Provider ¶
type Provider[T any] struct { // contains filtered or unexported fields }
func (*Provider[T]) MustGetNew ¶
func (*Provider[T]) MustRefresh ¶
type Providers ¶
type Providers[T any] struct { // contains filtered or unexported fields }
func NewProviders ¶
type Vipers ¶
type Vipers struct {
// contains filtered or unexported fields
}
func (*Vipers) GetOrCreateViper ¶
func (*Vipers) UnmarshalAndWatch ¶
Click to show internal directories.
Click to hide internal directories.