Documentation
¶
Index ¶
- func Provide(ref interface{}, funcImplementation interface{})
- func ProvideKeyValue(pointerToMap interface{}, key interface{}, value interface{})
- func ProvideSliceElement(pointerToSlice interface{}, element interface{})
- func Require(toInject interface{})
- func Reset()
- type EAlreadyResolved
- type EImplementationNotProvided
- type EImplementationProvidedForNonNil
- type EIncompatibleTypesFunc
- type EIncompatibleTypesStorage
- type EMultipleFuncImplementations
- type EMultipleStorageImplementations
- type EMultipleValues
- type ENonAssignableRequirement
- type EPackageNotUsed
- type Errors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Provide ¶
func Provide(ref interface{}, funcImplementation interface{})
Provide registers implementation of ref type
func ProvideKeyValue ¶ added in v0.2.0
func ProvideKeyValue(pointerToMap interface{}, key interface{}, value interface{})
ProvideKeyValue s.e.
func ProvideSliceElement ¶ added in v0.2.0
func ProvideSliceElement(pointerToSlice interface{}, element interface{})
ProvideSliceElement s.e.
Types ¶
type EAlreadyResolved ¶ added in v0.2.0
type EAlreadyResolved struct {
// contains filtered or unexported fields
}
EAlreadyResolved occurs on ResolveAll() call if it called already
func (*EAlreadyResolved) Error ¶ added in v0.2.0
func (e *EAlreadyResolved) Error() string
type EImplementationNotProvided ¶
type EImplementationNotProvided struct {
// contains filtered or unexported fields
}
EImplementationNotProvided error occurs if there is no implementation provided for a type
func (*EImplementationNotProvided) Error ¶
func (e *EImplementationNotProvided) Error() string
type EImplementationProvidedForNonNil ¶ added in v0.2.0
type EImplementationProvidedForNonNil struct {
// contains filtered or unexported fields
}
EImplementationProvidedForNonNil error occurs if target value is not nil but implementation provided
func (*EImplementationProvidedForNonNil) Error ¶ added in v0.2.0
func (e *EImplementationProvidedForNonNil) Error() string
type EIncompatibleTypesFunc ¶ added in v0.2.0
type EIncompatibleTypesFunc struct {
// contains filtered or unexported fields
}
EIncompatibleTypesFunc error occurs if type of a requirement (func) is incompatible to provided implementation
func (*EIncompatibleTypesFunc) Error ¶ added in v0.2.0
func (e *EIncompatibleTypesFunc) Error() string
type EIncompatibleTypesStorage ¶ added in v0.4.0
type EIncompatibleTypesStorage struct {
// contains filtered or unexported fields
}
EIncompatibleTypesStorage error occurs if type of an array or slice element or key or value of map is incompatible to provided implementation
func (*EIncompatibleTypesStorage) Error ¶ added in v0.4.0
func (e *EIncompatibleTypesStorage) Error() string
type EMultipleFuncImplementations ¶ added in v0.4.0
type EMultipleFuncImplementations struct {
// contains filtered or unexported fields
}
EMultipleFuncImplementations occurs if there are more than one implementations provided for one func
func (*EMultipleFuncImplementations) Error ¶ added in v0.4.0
func (e *EMultipleFuncImplementations) Error() string
type EMultipleStorageImplementations ¶ added in v0.4.0
type EMultipleStorageImplementations struct {
// contains filtered or unexported fields
}
EMultipleStorageImplementations occurs if there are more than one implementations provided for slice or map
func (*EMultipleStorageImplementations) Error ¶ added in v0.4.0
func (e *EMultipleStorageImplementations) Error() string
type EMultipleValues ¶
type EMultipleValues struct {
// contains filtered or unexported fields
}
EMultipleValues error occurs if more than one value is provided per one key by ProvideMapValue() call
func (*EMultipleValues) Error ¶
func (e *EMultipleValues) Error() string
type ENonAssignableRequirement ¶
type ENonAssignableRequirement struct {
// contains filtered or unexported fields
}
ENonAssignableRequirement error occurs if non-assignable (e.g. not variable) requirement is declared
func (*ENonAssignableRequirement) Error ¶
func (e *ENonAssignableRequirement) Error() string
type EPackageNotUsed ¶ added in v0.10.0
type EPackageNotUsed struct {
// contains filtered or unexported fields
}
EPackageNotUsed s.e.
func (*EPackageNotUsed) Error ¶ added in v0.10.0
func (e *EPackageNotUsed) Error() string