Documentation ¶
Index ¶
- Variables
- func Register[T any](dp *DependencyProvider, factory DependencyFactory[T])
- func RegisterLazySingleton[T any](dp *DependencyProvider, factory func() T)
- func RegisterSingleton[T any](dp *DependencyProvider, factory func() T)
- func RegisterWith[T, W any](dp *DependencyProvider, ...)
- func Resolve[T any](ctx context.Context, dp *DependencyProvider) (T, error)
- type DependencyFactory
- type DependencyProvider
- type FillOption
- type FillOptions
- type Fillable
- type IsFillabler
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Register ¶
func Register[T any](dp *DependencyProvider, factory DependencyFactory[T])
func RegisterLazySingleton ¶
func RegisterLazySingleton[T any](dp *DependencyProvider, factory func() T)
func RegisterSingleton ¶
func RegisterSingleton[T any](dp *DependencyProvider, factory func() T)
func RegisterWith ¶
Types ¶
type DependencyFactory ¶
type DependencyProvider ¶
type DependencyProvider struct {
// contains filtered or unexported fields
}
func NewDependencyProvider ¶
func NewDependencyProvider() *DependencyProvider
func (*DependencyProvider) Fill ¶
func (dp *DependencyProvider) Fill(ctx context.Context, v any, opts ...FillOption) error
func (*DependencyProvider) Register ¶
func (d *DependencyProvider) Register(factory any)
type FillOption ¶
type FillOption func(*FillOptions) *FillOptions
func AutoResolve ¶
func AutoResolve[T any]() FillOption
type FillOptions ¶
type FillOptions struct {
// contains filtered or unexported fields
}
type IsFillabler ¶
type IsFillabler interface {
IsFillable() bool
}
Click to show internal directories.
Click to hide internal directories.