Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bootstrap ¶
type Bootstrap struct {
// contains filtered or unexported fields
}
Bootstrap builds a list of initializers.
func (*Bootstrap) Add ¶
func (i *Bootstrap) Add(initializers ...Initializer) *Bootstrap
Add one or more initializers.
func (*Bootstrap) AddGroup ¶
func (i *Bootstrap) AddGroup(initializers []Initializer) *Bootstrap
AddGroup adds one or more initializers.
func (*Bootstrap) MustInitialize ¶
MustInitialize the current initializers.
type Initializer ¶
Initializer initializes a value, returning a corresponding Injector and Releaser.
type Injector ¶
Injector injects values into a Context.
func NewInjectors ¶
NewInjectors combines multiple injectors into one.
func NewNoopInjector ¶
func NewNoopInjector() Injector
NewNoopInjector returns an injector that does nothing.
func NewSingletonInjector ¶
func NewSingletonInjector(contextKey, value interface{}) Injector
NewSingletonInjector always injects the given value using the given context key.
type Releaser ¶
type Releaser func()
Releaser releases an initialized resource.
func NewCloseReleaser ¶
NewCloseReleaser returns a releaser that calls closer.Close, ignoring any returned error.
func NewNoopReleaser ¶
func NewNoopReleaser() Releaser
NewNoopReleaser returns a releaser that does nothing.
func NewReleasers ¶
NewReleasers combines multiple releasers into one (invoking them in reverse order).