container

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container interface {
	GetOrCreate(typeName, name string, creator CreateFunc, keys ...string) (interface{}, error)
	Remove(typeName, name string, keys ...string) error
	ICloser
}

IContainer 组件容器

func NewContainer

func NewContainer() Container

NewContainer 构建容器,用于管理公共组件

type CreateFunc

type CreateFunc func(setting config.Config) (interface{}, error)

type ICloser

type ICloser interface {
	Close() error
}

ICloser 关闭

type StandardBuilder

type StandardBuilder interface {
	Name() string
	Build(Container) interface{}
}

Jump to

Keyboard shortcuts

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