Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get(instance interface{}, method string) interface{}
Get returns a function for specified method. If you want to specify a method from an interface, you need to use (*ArbitraryInterface)(nil) as instance.
func Put ¶
func Put(instance interface{})
Put puts an instance in this container. The instance must have one or more methods.
func PutInterface ¶
func PutInterface(iface interface{}, instance interface{})
PutInterface puts an instance in this container. The instance must have one or more methods. The iface should be like (*ArbitraryInterface)(nil).
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container contains instances and mappings.
func (*Container) Get ¶
Get returns a function for specified method. If you want to specify a method from an interface, you need to use (*ArbitraryInterface)(nil) as instance.
func (*Container) Put ¶
func (c *Container) Put(instance interface{})
Put puts an instance in this container. The instance must have one or more methods.
func (*Container) PutInterface ¶
func (c *Container) PutInterface(iface interface{}, instance interface{})
PutInterface puts an instance in this container. The instance must have one or more methods. The iface should be like (*ArbitraryInterface)(nil).