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 AppInit
- type Application
- type CompositionName
- type Context
- type Defaultable
- type Disposable
- type Engine
- type Environment
- type IDefaultableModuleFactory
- type IModuleDependencyProvider
- type IModuleFactory
- type ImplName
- func NewCoreImplName(module, iface, version string) ImplName
- func NewCoreImplNameNoVer(module, iface string) ImplName
- func NewImplName(implType ImplType, module, implementation, version string) ImplName
- func NewImplNameNoVer(implType ImplType, module, iface string) ImplName
- func NewInfraImplName(module, iface, implementation string) ImplName
- func NewInfraImplNameNoVer(module, iface string) ImplName
- func NewModuleImplName(module, iface, implementation string) ImplName
- func NewModuleImplNameNoVer(module, iface string) ImplName
- func NewSceneImplName(module, iface, version string) ImplName
- func NewSceneImplNameNoVer(module, iface string) ImplName
- type ImplType
- type InfraName
- type InitArray
- type LensInit
- type ModuleFactory
- type ModuleFactoryArray
- type ModuleName
- type Named
- type Scene
- type Service
- type Setupable
- type WithContext
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 )
View Source
const Version = "0.4.0"
Variables ¶
View Source
var ( AppName string = "" AppBuildTime string = "0" AppBuildHash string = "0000000000000000000000000000000000000000" AppBuildVersion string = "v0.0.0" )
View Source
var DEFAULT_ENV string = "development"
DEFAULT_ENV is the environment variable that can be set to "production", "test" or "development" this is the default
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 Application ¶
type Application interface {
Name() ImplName // return scene
}
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 Defaultable ¶ added in v0.2.10
type Defaultable[T any] interface { Default() T }
type Disposable ¶
type Disposable interface {
Dispose() error
}
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 Defaultable[T] }
type IModuleDependencyProvider ¶
type IModuleDependencyProvider[T any] interface { Provide() T }
type IModuleFactory ¶
type ImplName ¶
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 NewSceneImplName ¶
func NewSceneImplNameNoVer ¶
func (ImplName) ExportName ¶ added in v0.2.8
ExportName return interface name with capitalized module name used by arpc
func (ImplName) Identifier ¶
Identifier returns a string identifier of the implementation name.
func (ImplName) MethodName ¶ added in v0.3.2
MethodName return method name in the for this interface used by mcp tools
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(iface, implementation 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 Scene ¶ added in v0.3.0
type Scene interface {
Named
Start() error // start container
Stop(ctx context.Context) error // stop container
ListAppNames() []string // return application names
}
Scene is the delivery (controller) layer container, contains application from each module
type WithContext ¶ added in v0.2.10
Source Files
¶
Click to show internal directories.
Click to hide internal directories.
