container

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultContainerName 默认容器名称
	DefaultContainerName string = "_default_"
)

Variables

This section is empty.

Functions

func Delete

func Delete(name string)

Delete 删除容器

func Invoke

func Invoke(fn interface{}, opts ...InvokeOption) error

func MustInvoke

func MustInvoke(fn interface{}, opts ...InvokeOption)

func MustProvide

func MustProvide(ctor interface{}, opts ...ProvideOption)

func Provide

func Provide(ctor interface{}, opts ...ProvideOption) error

Types

type Container

type Container struct {
	// contains filtered or unexported fields
}

Container 容器

func Default

func Default() *Container

获取默认容器

func Get

func Get(name string) *Container

Get 获取容器

func New

func New(option ...Option) *Container

New创建一个容器

func (*Container) Invoke

func (c *Container) Invoke(fn interface{}, opts ...InvokeOption) error

func (*Container) Provide

func (c *Container) Provide(ctor interface{}, opts ...ProvideOption) error

Container ----------------------------------------------------------------------------------

type InvokeOption

type InvokeOption interface {
}

type Option

type Option struct {
	Name string // 容器名字
}

Option 容器选项

type ProvideOption

type ProvideOption interface {
}

ProviderOption a provideOption modifies the default behavior of Provide.

Jump to

Keyboard shortcuts

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