Documentation ¶
Index ¶
- func InterfaceOf(value interface{}) reflect.Type
- type Applicator
- type Injector
- type Invoker
- type List
- func (this *List) Back() *list.Element
- func (this *List) BackAll() []interface{}
- func (this *List) BackItem() interface{}
- func (this *List) BatchPopBack(max int) []interface{}
- func (this *List) BatchPopFront(max int) []interface{}
- func (this *List) BatchPushFront(vs []interface{})
- func (this *List) Front() *list.Element
- func (this *List) FrontAll() []interface{}
- func (this *List) FrontItem() interface{}
- func (this *List) InsertAfter(v interface{}, mark *list.Element) *list.Element
- func (this *List) InsertBefore(v interface{}, mark *list.Element) *list.Element
- func (this *List) Len() int
- func (this *List) PopBack() interface{}
- func (this *List) PopBackAll() []interface{}
- func (this *List) PopFront() interface{}
- func (this *List) PopFrontAll() []interface{}
- func (this *List) PushBack(v interface{}) *list.Element
- func (this *List) PushFront(v interface{}) *list.Element
- func (this *List) Remove(e *list.Element) interface{}
- func (this *List) RemoveAll()
- type Map
- type TypeMapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InterfaceOf ¶
InterfaceOf dereferences a pointer to an Interface type. It panics if value is not an pointer to an interface.
Types ¶
type Applicator ¶
type Applicator interface { // Maps dependencies in the Type map to each field in the struct // that is tagged with 'inject'. Returns an error if the injection // fails. Apply(interface{}) error }
Applicator represents an interface for mapping dependencies to a struct.
type Injector ¶
type Injector interface { Applicator Invoker TypeMapper // SetParent sets the parent of the injector. If the injector cannot find a // dependency in its Type map it will check its parent before returning an // error. SetParent(Injector) }
Injector represents an interface for mapping and injecting dependencies into structs and function arguments.
type Invoker ¶
type Invoker interface { // Invoke attempts to call the interface{} provided as a function, // providing dependencies for function arguments based on Type. Returns // a slice of reflect.Value representing the returned values of the function. // Returns an error if the injection fails. Invoke(interface{}) ([]reflect.Value, error) }
Invoker represents an interface for calling functions via reflection.
type List ¶ added in v0.1.2
type List struct {
// contains filtered or unexported fields
}
变长双向链表
func (*List) BatchPopBack ¶ added in v0.1.2
批量从链表尾端出栈数据项(删除)
func (*List) BatchPopFront ¶ added in v0.1.2
批量从链表头端出栈数据项(删除)
func (*List) BatchPushFront ¶ added in v0.1.2
func (this *List) BatchPushFront(vs []interface{})
批量往链表头入栈数据项
func (*List) InsertAfter ¶ added in v0.1.2
在list 中元素mark之后插入一个值为v的元素,并返回该元素,如果mark不是list中元素,则list不改变。
func (*List) InsertBefore ¶ added in v0.1.2
在list 中元素mark之前插入一个值为v的元素,并返回该元素,如果mark不是list中元素,则list不改变。
func (*List) PopBackAll ¶ added in v0.1.2
func (this *List) PopBackAll() []interface{}
批量从链表尾端依次获取所有数据(删除)
func (*List) PopFrontAll ¶ added in v0.1.2
func (this *List) PopFrontAll() []interface{}
批量从链表头端依次获取所有数据(删除)
type TypeMapper ¶
type TypeMapper interface { // Maps the interface{} value based on its immediate type from reflect.TypeOf. Map(interface{}) TypeMapper // Maps the interface{} value based on the pointer of an Interface provided. // This is really only useful for mapping a value as an interface, as interfaces // cannot at this time be referenced directly without a pointer. MapTo(interface{}, interface{}) TypeMapper // Provides a possibility to directly insert a mapping based on type and value. // This makes it possible to directly map type arguments not possible to instantiate // with reflect like unidirectional channels. Set(reflect.Type, reflect.Value) TypeMapper // Returns the Value that is mapped to the current type. Returns a zeroed Value if // the Type has not been mapped. Get(reflect.Type) reflect.Value }
TypeMapper represents an interface for mapping interface{} values based on type.