Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AnimalsSet = wire.NewSet( wire.Struct(new(Bird), "*"), wire.Bind(new(FlyAnimal), new(*Bird)), wire.Struct(new(Cat), "*"), NewLion, ProvideDog, InitSomeTiger, )
View Source
var ConfigSet = wire.NewSet( wire.FieldsOf(new(*Config), "AnonymousConfigField2", "ConfigField", ), )
View Source
var Sets = wire.NewSet( AnimalsSet, ConfigSet, ZooSet, )
Functions ¶
This section is empty.
Types ¶
type AnonymousConfigField2 ¶
type AnonymousConfigField2 struct { }
type Config ¶
type Config struct { ConfigField ConfigField AnonymousConfigField2 }
@autowire.config(set=config)
type ConfigField ¶
type ConfigField struct { }
type Dog ¶
type Dog struct{}
use provider func
func ProvideDog ¶
func ProvideDog() Dog
it will be collect into animalsSet user provider func @autowire(set=animals)
type Lion ¶
type Lion struct{}
it will be collect into animalsSet as it has a New method it will use NewLion as provider @autowire(set=animals)
type Tiger ¶
type Tiger struct{}
it will be collect into animalsSet as it has a New method it will use NewLion as provider @autowire(set=animals,new=InitSomeTiger)
func InitSomeTiger ¶
func InitSomeTiger() Tiger
type Zoo ¶
type Zoo struct { Cat Cat Dog Dog Lion Lion FlyAnimal FlyAnimal ConfigField ConfigField AnonymousConfigField2 Tiger }
it will be collect into zooSet use init to create initZoo method in wire.gen.go @autowire.init(set=zoo)
func InitializeZoo ¶
Click to show internal directories.
Click to hide internal directories.