Documentation
¶
Index ¶
- Constants
- Variables
- func BuildApps[T Application](builders ModuleFactoryArray) []T
- func ContextFindValue[T any](ctx Context) (T, bool)
- func ContextSetValue[T any](ctx Context, value T)
- func GetInterfaceName[T any]() string
- func SetEnvironment(e Environment)
- type AppContainerStatus
- type AppInit
- type AppStatus
- type Application
- type ApplicationContainer
- type ApplicationFactory
- type ApplicationManager
- type CompositionName
- type Context
- type Disposable
- type Engine
- type Environment
- type IDefaultableModuleFactory
- type IModuleDependencyProvider
- type IModuleFactory
- type ImplName
- func NewAppImplName(module, implementation, version string) ImplName
- func NewAppImplNameNoVer(module, implementation string) ImplName
- func NewCoreImplName(module, implementation, version string) ImplName
- func NewCoreImplNameNoVer(module, implementation string) ImplName
- func NewImplName(implType ImplType, module, implementation, version string) ImplName
- func NewImplNameNoVer(implType ImplType, module, implementation string) ImplName
- func NewInfraImplName(module, implementation, version string) ImplName
- func NewInfraImplNameNoVer(module, implementation string) ImplName
- func NewModuleImplName(module, implementation, version string) ImplName
- func NewModuleImplNameNoVer(module, implementation string) ImplName
- func NewRepoImplName(module, implementation, version string) ImplNamedeprecated
- func NewRepoImplNameNoVer(module, implementation string) ImplNamedeprecated
- func NewSceneImplName(module, implementation, version string) ImplName
- func NewSceneImplNameNoVer(module, implementation string) ImplName
- func NewSrvImplName(module, implementation, version string) ImplNamedeprecated
- func NewSrvImplNameNoVer(module, implementation string) ImplNamedeprecated
- type ImplType
- type InfraName
- type InitArray
- type LensInit
- type ModuleFactory
- type ModuleFactoryArray
- type ModuleName
- type NamableImplementation
- type Repository
- type Service
- type Setupable
Constants ¶
View Source
const ( ImplTypeCore = ImplType("core") // core type ImplTypeScene = ImplType("scene") // scenario type ImplTypeInfra = ImplType("infra") // infrastructure type ImplTypeComp = ImplType("composite") // composition type ImplTypeModule = ImplType("module") // module type ImplTypeRepo = ImplType("repo") // module repository type ImplTypeSrv = ImplType("srv") // module service type ImplTypeApp = ImplType("app") // module application type )
View Source
const Version = "0.3.5"
Variables ¶
View Source
var ( AppBuildTime string = "0" AppBuildHash string = "0000000000000000000000000000000000000000" AppBuildVersion string = "v0.0.0" )
Functions ¶
func BuildApps ¶
func BuildApps[T Application](builders ModuleFactoryArray) []T
func ContextFindValue ¶
func ContextSetValue ¶
func GetInterfaceName ¶
func SetEnvironment ¶ added in v0.2.6
func SetEnvironment(e Environment)
Types ¶
type AppContainerStatus ¶
type AppContainerStatus int
const ( AppContainerStatusStopped AppContainerStatus = iota AppContainerStatusRunning AppContainerStatusError )
type AppInit ¶
type AppInit[T Application] func() T
type Application ¶
type Application interface {
Name() ImplName // return scene
}
type ApplicationContainer ¶
type ApplicationFactory ¶
type ApplicationFactory[T Application] interface { Name() string // return factory name Create(app T) error // create application Destroy(app T) error // not used for now }
type ApplicationManager ¶
type ApplicationManager[T Application] interface { Name() string // return registry name LoadApp(app T) error // load application LoadApps(apps ...T) error // load applications GetApp(appID string) T // return application ListAppNames() []string // return application names ListApps() []T // return list of applications }
type CompositionName ¶ added in v0.2.6
type CompositionName string
func (CompositionName) ImplName ¶ added in v0.2.6
func (c CompositionName) ImplName(implementation, version string) ImplName
func (CompositionName) ImplNameNoVer ¶ added in v0.2.6
func (c CompositionName) ImplNameNoVer(implementation string) ImplName
func (CompositionName) String ¶ added in v0.2.6
func (c CompositionName) String() string
type Context ¶
Context should be a "context container" that store module's context
func NewContext ¶
func NewContext() Context
type Disposable ¶
type Disposable interface {
Dispose() error
}
type Engine ¶
type Engine interface {
Run() error
Start() error
Stop()
ListContainers() []ApplicationContainer
GetContainer(name string) ApplicationContainer
}
type Environment ¶ added in v0.2.6
type Environment uint8
const ( EnvDevelopment Environment = iota EnvProduction EnvTest )
func GetEnvironment ¶ added in v0.2.6
func GetEnvironment() Environment
func (Environment) String ¶ added in v0.2.6
func (e Environment) String() string
type IDefaultableModuleFactory ¶
type IDefaultableModuleFactory[T any] interface { IModuleFactory Default() T }
type IModuleDependencyProvider ¶
type IModuleDependencyProvider[T any] interface { Provide() T }
type IModuleFactory ¶
type ImplName ¶
func NewAppImplName ¶
NewModuleImplName creates a new module implementation name. Deprecated: use NewModuleImplNameNoVer instead
func NewAppImplNameNoVer ¶
NewModuleImplName creates a new module implementation name. Deprecated: use NewModuleImplNameNoVer instead
func NewCoreImplName ¶
func NewCoreImplNameNoVer ¶
func NewImplName ¶
func NewImplNameNoVer ¶
func NewInfraImplName ¶ added in v0.2.6
func NewInfraImplNameNoVer ¶ added in v0.2.6
func NewModuleImplName ¶ added in v0.2.6
func NewModuleImplNameNoVer ¶ added in v0.2.6
func NewRepoImplName
deprecated
func NewRepoImplNameNoVer
deprecated
func NewSceneImplName ¶
func NewSceneImplNameNoVer ¶
func NewSrvImplName
deprecated
func NewSrvImplNameNoVer
deprecated
func (ImplName) EndpointName ¶
func (ImplName) Identifier ¶
Identifier returns a string identifier of the implementation name.
type InfraName ¶ added in v0.2.6
type InfraName string
func (InfraName) ImplNameNoVer ¶ added in v0.2.6
type InitArray ¶
type InitArray []LensInit
func BuildInitArray ¶
func BuildInitArray(builders ModuleFactoryArray) InitArray
type LensInit ¶
type LensInit func()
LensInit is a function initialize a lens if error happens, it should panic
type ModuleFactory ¶
type ModuleFactory struct {
}
func (ModuleFactory) Apps ¶
func (b ModuleFactory) Apps() []any
func (ModuleFactory) Init ¶
func (b ModuleFactory) Init() LensInit
type ModuleFactoryArray ¶
type ModuleFactoryArray []IModuleFactory
type ModuleName ¶ added in v0.2.6
type ModuleName string
func (ModuleName) ImplName ¶ added in v0.2.6
func (l ModuleName) ImplName(implementation, version string) ImplName
func (ModuleName) ImplNameNoVer ¶ added in v0.2.6
func (l ModuleName) ImplNameNoVer(implementation string) ImplName
func (ModuleName) String ¶ added in v0.2.6
func (l ModuleName) String() string
func (ModuleName) TableName ¶ added in v0.2.6
func (l ModuleName) TableName(table string) string
type NamableImplementation ¶
type NamableImplementation interface {
ImplName() ImplName
}
type Repository ¶
type Repository interface {
RepoImplName() ImplName
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.
