Documentation ¶
Index ¶
- func Extract(name, tag string) (found bool, value string, err error)
- func Populate(values ...interface{}) error
- type Container
- func (g *Container) Objects() []*Object
- func (g *Container) Populate() error
- func (g *Container) PopulateTarget(dst interface{}) error
- func (g *Container) Provide(objects ...*Object) error
- func (g *Container) Resolve(dst interface{}) error
- func (g *Container) ResolveByName(dst interface{}, name string) error
- type Logger
- type Object
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Container ¶
type Container struct { Logger Logger // Optional, will trigger debug logging. // contains filtered or unexported fields }
The Container of Objects.
func (*Container) Objects ¶
Objects returns all known objects, named as well as unnamed. The returned elements are not in a stable order.
func (*Container) PopulateTarget ¶
func (*Container) Provide ¶
Provide objects to the Container. The Object documentation describes the impact of various fields.
func (*Container) ResolveByName ¶
ResolveByName sets the value of dst to an assignable instance with the provided name
type Logger ¶
type Logger interface {
Debugf(format string, v ...interface{})
}
Logger allows for simple logging as inject traverses and populates the object Container.
type Object ¶
type Object struct { Value interface{} Name string // Optional Complete bool // If true, the Value will be considered complete Fields map[string]*Object // Populated with the field names that were injected and their corresponding *Object. // contains filtered or unexported fields }
An Object in the Container.
Click to show internal directories.
Click to hide internal directories.