Documentation
¶
Index ¶
- type Container
- type ErrParameterProvideFailed
- type ErrParameterProviderNotFound
- type ExtractParams
- type Extractor
- type Graph
- type InvokeParams
- type Parameter
- type ParameterBag
- func (b ParameterBag) Exists(key string) bool
- func (b ParameterBag) Float64(key string) (float64, bool)
- func (b ParameterBag) Get(key string) (interface{}, bool)
- func (b ParameterBag) Int(key string) (int, bool)
- func (b ParameterBag) Int64(key string) (int64, bool)
- func (b ParameterBag) Require(key string) interface{}
- func (b ParameterBag) RequireFloat64(key string) float64
- func (b ParameterBag) RequireInt(key string) int
- func (b ParameterBag) RequireInt64(key string) int64
- func (b ParameterBag) RequireString(key string) string
- func (b ParameterBag) String(key string) (string, bool)
- type ProvideParams
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
}
Container is a dependency injection container.
func (*Container) Compile ¶
func (c *Container) Compile()
Compile compiles the container. It iterates over all nodes in graph and register their parameters.
func (*Container) Invoke ¶ added in v2.2.0
func (c *Container) Invoke(params InvokeParams) error
Invoke calls provided function.
func (*Container) Provide ¶
func (c *Container) Provide(params ProvideParams)
Provide adds constructor into container with parameters.
type ErrParameterProvideFailed ¶ added in v2.2.2
type ErrParameterProvideFailed struct {
// contains filtered or unexported fields
}
ErrParameterProvideFailed
func (ErrParameterProvideFailed) Error ¶ added in v2.2.2
func (e ErrParameterProvideFailed) Error() string
type ErrParameterProviderNotFound ¶ added in v2.2.2
type ErrParameterProviderNotFound struct {
// contains filtered or unexported fields
}
ErrParameterProviderNotFound
func (ErrParameterProviderNotFound) Error ¶ added in v2.2.2
func (e ErrParameterProviderNotFound) Error() string
type InvokeParams ¶ added in v2.2.0
type InvokeParams struct {
// The function
Fn interface{}
}
InvokeParams
type ParameterBag ¶
type ParameterBag map[string]interface{}
Parameters
func (ParameterBag) Float64 ¶ added in v2.0.1
func (b ParameterBag) Float64(key string) (float64, bool)
Float64
func (ParameterBag) Get ¶ added in v2.0.1
func (b ParameterBag) Get(key string) (interface{}, bool)
Get
func (ParameterBag) Int64 ¶ added in v2.0.1
func (b ParameterBag) Int64(key string) (int64, bool)
Int64
func (ParameterBag) Require ¶ added in v2.0.1
func (b ParameterBag) Require(key string) interface{}
Require
func (ParameterBag) RequireFloat64 ¶ added in v2.0.1
func (b ParameterBag) RequireFloat64(key string) float64
RequireFloat64
func (ParameterBag) RequireInt ¶ added in v2.0.1
func (b ParameterBag) RequireInt(key string) int
RequireInt
func (ParameterBag) RequireInt64 ¶ added in v2.0.1
func (b ParameterBag) RequireInt64(key string) int64
RequireInt64
func (ParameterBag) RequireString ¶
func (b ParameterBag) RequireString(key string) string
RequireString
type ProvideParams ¶
type ProvideParams struct {
Name string
Provider interface{}
Interfaces []interface{}
Parameters ParameterBag
IsPrototype bool
}
ProvideParams is a `Provide()` method options. Name is a unique identifier of type instance. Provider is a constructor function. Interfaces is a interface that implements a provider result type.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.