inject

package
v0.0.0-...-0fa378f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2015 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package inject is a simple implementation of injection Once it is mature, it should probably be carved out into its own library

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BindPartial

type BindPartial struct {
	// contains filtered or unexported fields
}

func (BindPartial) ToInstance

func (self BindPartial) ToInstance(instance interface{})

type Binder

type Binder struct {
	// contains filtered or unexported fields
}

func NewBinder

func NewBinder() *Binder

func (*Binder) AddDefaultBinding

func (self *Binder) AddDefaultBinding(t reflect.Type)

func (*Binder) AddDefaultBindingByPointer

func (self *Binder) AddDefaultBindingByPointer(p interface{})

func (*Binder) AddProvider

func (self *Binder) AddProvider(fn interface{})

func (*Binder) AddSingleton

func (self *Binder) AddSingleton(obj interface{})

func (*Binder) Bind

func (self *Binder) Bind(prototype interface{}) BindPartial

func (*Binder) BindType

func (self *Binder) BindType(t reflect.Type) BindPartial

func (*Binder) CreateInjector

func (self *Binder) CreateInjector() Injector

func (*Binder) Get

func (self *Binder) Get(t reflect.Type) (interface{}, error)

type BinderInjector

type BinderInjector struct {
	// contains filtered or unexported fields
}

func (*BinderInjector) Get

func (self *BinderInjector) Get(t reflect.Type) (interface{}, error)

func (*BinderInjector) Inject

func (self *BinderInjector) Inject(p interface{}) error

type Binding

type Binding interface {
	Get() (interface{}, error)
}

type DefaultBinding

type DefaultBinding struct {
	// contains filtered or unexported fields
}

func NewDefaultBinding

func NewDefaultBinding(t reflect.Type) *DefaultBinding

func (*DefaultBinding) Get

func (self *DefaultBinding) Get() (interface{}, error)

type FunctionBinding

type FunctionBinding struct {
	// contains filtered or unexported fields
}

func (*FunctionBinding) Get

func (self *FunctionBinding) Get() (interface{}, error)

type Injector

type Injector interface {
	Get(t reflect.Type) (interface{}, error)
	Inject(p interface{}) error
}

type SingletonBinding

type SingletonBinding struct {
	// contains filtered or unexported fields
}

func (*SingletonBinding) Get

func (self *SingletonBinding) Get() (interface{}, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL