container

package
Version: v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultContainer = NewContainer()
)

Functions

This section is empty.

Types

type Container

type Container struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewContainer

func NewContainer() *Container

func (*Container) Configure

func (this *Container) Configure(name string, cfg interface{}) error

func (*Container) ConfigureAll

func (this *Container) ConfigureAll(cfg map[string]interface{}) error

func (*Container) Create

func (this *Container) Create(cfg interface{}) (interface{}, error)

func (*Container) Creator

func (this *Container) Creator(cfg interface{}) (interface{}, error)

当传进来的type为container时,进入到这个Creator

func (*Container) Get

func (this *Container) Get(names ...string) (interface{}, error)

func (*Container) GetContainer

func (this *Container) GetContainer(name string) (*Container, error)

func (*Container) Register

func (this *Container) Register(name string, creator Creator)

func (*Container) Set

func (this *Container) Set(name string, instance interface{})

type Creator

type Creator func(cfg interface{}) (interface{}, error)

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL