config

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: MIT Imports: 7 Imported by: 43

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadResourcesFromEmbedFS added in v0.0.33

func LoadResourcesFromEmbedFS(fs *embed.FS, path string) collection.Resources

LoadResourcesFromEmbedFS 从嵌入的FS加载资源组

func NewBuilder

func NewBuilder() application.ConfigBuilder

NewBuilder 新建配置建造器

func NewBuilderRes

func NewBuilderRes(res collection.Resources) application.ConfigBuilder

NewBuilderRes 新建配置建造器,并附带指定的资源

Types

type ComInfo

type ComInfo struct {
	// implements ComponentInfo
	ID      string
	Class   string
	Scope   application.ComponentScope
	Aliases []string

	OnNew     OnNew
	OnInject  OnInject
	OnInit    OnInit
	OnDestroy OnDestroy
}

ComInfo 提供一个简易的 ComponentInfo 实现

func (*ComInfo) GetAliases

func (inst *ComInfo) GetAliases() []string

GetAliases 获取组件的别名

func (*ComInfo) GetClass

func (inst *ComInfo) GetClass() string

GetClass 获取组件的类

func (*ComInfo) GetClasses

func (inst *ComInfo) GetClasses() []string

GetAliases 获取组件的别名

func (*ComInfo) GetFactory

func (inst *ComInfo) GetFactory() application.ComponentFactory

GetFactory 获取组件的工厂

func (*ComInfo) GetID

func (inst *ComInfo) GetID() string

GetID 获取组件的ID

func (*ComInfo) GetPrototype

func (inst *ComInfo) GetPrototype() lang.Object

GetPrototype 获取组件的原型

func (*ComInfo) GetScope

func (inst *ComInfo) GetScope() application.ComponentScope

GetScope 获取组件的作用域

func (*ComInfo) IsNameOf

func (inst *ComInfo) IsNameOf(name string) bool

IsNameOf 判断 id(or alias) 是否匹配

func (*ComInfo) IsTypeOf

func (inst *ComInfo) IsTypeOf(name string) bool

IsTypeOf 判断 class 是否匹配

type ComInfoBuilder added in v0.0.6

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

func (*ComInfoBuilder) Aliases added in v0.0.6

func (inst *ComInfoBuilder) Aliases(aliases string) *ComInfoBuilder

func (*ComInfoBuilder) Class added in v0.0.6

func (inst *ComInfoBuilder) Class(cls string) *ComInfoBuilder

func (*ComInfoBuilder) Create added in v0.0.6

func (inst *ComInfoBuilder) Create() (*ComInfo, error)

func (*ComInfoBuilder) CreateTo added in v0.0.7

func (inst *ComInfoBuilder) CreateTo(cb application.ConfigBuilder) error

func (*ComInfoBuilder) ID added in v0.0.6

func (inst *ComInfoBuilder) ID(id string) *ComInfoBuilder

func (*ComInfoBuilder) OnDestroy added in v0.0.7

func (inst *ComInfoBuilder) OnDestroy(fn OnDestroy) *ComInfoBuilder

func (*ComInfoBuilder) OnInit added in v0.0.7

func (inst *ComInfoBuilder) OnInit(fn OnInit) *ComInfoBuilder

func (*ComInfoBuilder) OnInject added in v0.0.7

func (inst *ComInfoBuilder) OnInject(fn OnInject) *ComInfoBuilder

func (*ComInfoBuilder) OnNew added in v0.0.7

func (inst *ComInfoBuilder) OnNew(fn OnNew) *ComInfoBuilder

func (*ComInfoBuilder) Reset added in v0.0.7

func (inst *ComInfoBuilder) Reset()

func (*ComInfoBuilder) Scope added in v0.0.6

func (inst *ComInfoBuilder) Scope(scope string) *ComInfoBuilder

type OnDestroy added in v0.0.7

type OnDestroy func(obj lang.Object) error

type OnInit added in v0.0.7

type OnInit func(obj lang.Object) error

type OnInject added in v0.0.7

type OnInject func(obj lang.Object, context application.Context) error

type OnNew added in v0.0.7

type OnNew func() lang.Object

Jump to

Keyboard shortcuts

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