Documentation ¶
Index ¶
- Constants
- func Activators(activators ...*Activator) error
- func Close(ctx context.Context) error
- func Configurer() config.Configurer
- func Get[T any](ctx context.Context, key any, c ...Container) (value T, err error)
- func Has(key any, c ...Container) bool
- func Init(cfg config.Configurer)
- func Must[T any](value T, err error) T
- func MustGet[T any](ctx context.Context, key any, c ...Container) T
- func MustNew[T any](ctx context.Context, key any, c ...Container) T
- func New[T any](ctx context.Context, key any, c ...Container) (value T, err error)
- func Register(key any, factory Factory) error
- type Activator
- type Closer
- type CloserFunc
- type Container
- type Factory
- type FactoryFunc
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func Activators ¶
func Configurer ¶
func Configurer() config.Configurer
func Init ¶
func Init(cfg config.Configurer)
Types ¶
type CloserFunc ¶
type Container ¶
type Container interface { Configurer() config.Configurer Activators(activators ...*Activator) error Register(key any, factory Factory) error Close(ctx context.Context) error New(ctx context.Context, key any) (any, error) Get(ctx context.Context, key any) (any, error) Has(key any) bool }
func NewContainer ¶
func NewContainer(cfg config.Configurer) Container
Click to show internal directories.
Click to hide internal directories.