Documentation ¶
Index ¶
- Constants
- 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
- type AppContainerStatus
- type AppInit
- type AppStatus
- type Application
- type ApplicationContainer
- type ApplicationFactory
- type ApplicationManager
- type Context
- type Disposable
- type Engine
- 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 NewRepoImplName(module, implementation, version string) ImplName
- func NewRepoImplNameNoVer(module, implementation string) ImplName
- func NewSceneImplName(module, implementation, version string) ImplName
- func NewSceneImplNameNoVer(module, implementation string) ImplName
- func NewSrvImplName(module, implementation, version string) ImplName
- func NewSrvImplNameNoVer(module, implementation string) ImplName
- type ImplType
- type InitArray
- type LensInit
- type ModuleFactory
- type ModuleFactoryArray
- type NamableImplementation
- type Repository
- type Service
- type Setupable
Constants ¶
View Source
const ( ImplTypeCore = ImplType("core") ImplTypeRepo = ImplType("repo") ImplTypeSrv = ImplType("srv") ImplTypeApp = ImplType("app") ImplTypeScene = ImplType("scene") )
View Source
const Version = "0.3.0"
Variables ¶
This section is empty.
Functions ¶
func BuildApps ¶
func BuildApps[T Application](builders ModuleFactoryArray) []T
func ContextFindValue ¶
func ContextSetValue ¶
func GetInterfaceName ¶
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 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 IDefaultableModuleFactory ¶
type IDefaultableModuleFactory[T any] interface { IModuleFactory Default() T }
type IModuleDependencyProvider ¶
type IModuleDependencyProvider[T any] interface { Provide() T }
type IModuleFactory ¶
type ImplName ¶
func NewAppImplName ¶
func NewAppImplNameNoVer ¶
func NewCoreImplName ¶
func NewCoreImplNameNoVer ¶
func NewImplName ¶
func NewImplNameNoVer ¶
func NewRepoImplName ¶
func NewRepoImplNameNoVer ¶
func NewSceneImplName ¶
func NewSceneImplNameNoVer ¶
func NewSrvImplName ¶
func NewSrvImplNameNoVer ¶
func (ImplName) EndpointName ¶
func (ImplName) Identifier ¶
Identifier returns a string identifier of the implementation name.
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 NamableImplementation ¶
type NamableImplementation interface {
ImplName() ImplName
}
type Repository ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.