Documentation ¶
Overview ¶
Fork from github.com/facebookgo/inject By BUPTCZQ
Package startstop provides automatic Start/Stop for inject eliminating the necessity for manual ordering.
Index ¶
- Variables
- type Closer
- type Container
- func (c *Container) Get(name string) interface{}
- func (c *Container) GetMap() map[string]reflect.Type
- func (c *Container) GetType(name string) reflect.Type
- func (c *Container) Register(proto interface{})
- func (c *Container) XMLConfigurationContainer(data []byte, logger Logger) (*Graph, error)
- func (c *Container) XMLFileConfigurationContainer(filename string, logger Logger) (*Graph, error)
- type Dependence
- type Dew
- type Graph
- type Logger
- type Opener
- type Option
- type Starter
- type Stopper
- type VaporOption
Constants ¶
This section is empty.
Variables ¶
var UMARSHALTEXT_TYPE = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem()
Functions ¶
This section is empty.
Types ¶
type Closer ¶
Closer defines the Close method, objects satisfying this interface will be closed by Stop.
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func (*Container) XMLConfigurationContainer ¶
type Dew ¶
type Dew struct { Value interface{} Name string // Optional Complete bool // If true, the Value will be considered complete Options map[string]Option // The field names that named dependency were injected into Dependencies []*Dependence // Dew's Dependencies // contains filtered or unexported fields }
An Dew in the Graph.
type Graph ¶
type Graph struct { Logger Logger // Optional, will trigger debug logging. // contains filtered or unexported fields }
The Graph of Objects.
func (*Graph) GetDewByName ¶
func (*Graph) Objects ¶
Objects returns all known objects, named as well as unnamed. The returned elements are not in a stable order.
func (*Graph) Provide ¶
Provide objects to the Graph. The Dew documentation describes the impact of various fields.
type Logger ¶
type Logger interface { Debugf(f string, args ...interface{}) Errorf(f string, args ...interface{}) }
Logger allows for simple logging as inject traverses and populates the object graph.
type Opener ¶
Opener defines the Open method, objects satisfying this interface will be opened by Start.
type Starter ¶
Starter defines the Start method, objects satisfying this interface will be started by Start.