Documentation ¶
Index ¶
- Variables
- func Bind(target interface{}) error
- func MustBind(target interface{})
- func NewBinder(target interface{}, registry *Ioc) *bind
- func Register(name string, value interface{}, opts ...RegistryOption)
- type Ioc
- func (r *Ioc) Bind(target interface{}) error
- func (r *Ioc) FetchByName(name string) (interface{}, error)
- func (r *Ioc) FetchByType(t reflect.Type) (interface{}, error)
- func (r *Ioc) FuncMatchType(v reflect.Value, target reflect.Type) bool
- func (r *Ioc) Register(name string, value interface{}, opts ...RegistryOption)
- type RegistryOption
- type Tag
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotSupport = fmt.Errorf("dp bind should be used on struct")
)
Functions ¶
func Register ¶
func Register(name string, value interface{}, opts ...RegistryOption)
Types ¶
type Ioc ¶
type Ioc struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *Ioc
func (*Ioc) Register ¶
func (r *Ioc) Register(name string, value interface{}, opts ...RegistryOption)
type RegistryOption ¶
type RegistryOption func(*registryItem)
func WithNoBind ¶
func WithNoBind() RegistryOption
Click to show internal directories.
Click to hide internal directories.