config

package
v0.0.0-...-6a6267a Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

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

AppConfig 提供一个简易的 Configuration 实现

func (*AppConfig) AddComponent

func (inst *AppConfig) AddComponent(info application.ComponentInfo)

AddComponent 注册一个组件

func (*AppConfig) GetBuilder

func (inst *AppConfig) GetBuilder() application.ConfigBuilder

GetBuilder 返回构建器

func (*AppConfig) GetComponents

func (inst *AppConfig) GetComponents() []application.ComponentInfo

GetComponents 返回组件的注册信息

func (*AppConfig) GetLoader

func (inst *AppConfig) GetLoader() application.ContextLoader

GetLoader 返回加载器

func (*AppConfig) GetResources

func (inst *AppConfig) GetResources() collection.Resources

GetResources 用于获取上下文的资源文件夹

func (*AppConfig) SetResources

func (inst *AppConfig) SetResources(fs *embed.FS, prefix string)

SetResources 用于配置上下文的资源文件夹

type ComInfo

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

	OnNew     func() lang.Object
	OnInit    func(obj lang.Object) error
	OnDestroy func(obj lang.Object) error
	OnInject  func(obj lang.Object, context application.RuntimeContext) error
	// contains filtered or unexported fields
}

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) 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 是否匹配

Jump to

Keyboard shortcuts

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