Documentation ¶
Index ¶
- Constants
- func GetConfigTemplatePath(workPath string) string
- func LaunchDaemonApplication(processType ProcessType, workPath string, launchConf string, ...) error
- func RegisterComponentInfo(priority int, tpy ComponentType, newComponent NewComponent, ...)
- func RegisterConfigCallback(cbType ConfigCallbackType, conf IConfig, f ConfigCallback) bool
- func RegisterConfigInfo(info ConfigRegInfo)
- func SetFrameLoggerInstance(logger ILogger) bool
- type ApplicationID
- type ApplicationProxy
- type BaseApplication
- func (t *BaseApplication) AfterStart() error
- func (t *BaseApplication) GetID() ApplicationID
- func (t *BaseApplication) GetProcessType() ProcessType
- func (t *BaseApplication) Initialize(args ...interface{}) error
- func (t *BaseApplication) Pub(topic TopicType, args ...interface{}) error
- func (t *BaseApplication) StopBefore() error
- func (t *BaseApplication) Sub(topic TopicType, subKey TopicSubKey, handle pubsub.TopicFunc, ...) error
- type BaseComponent
- func (t *BaseComponent) GetID() ComponentID
- func (t *BaseComponent) GetNum() int
- func (t *BaseComponent) GetStartTimestamp() int64
- func (t *BaseComponent) GetStatus() ComponentStatus
- func (t *BaseComponent) GetType() ComponentType
- func (t *BaseComponent) Initialize(args ...interface{}) error
- func (t *BaseComponent) Start() error
- func (t *BaseComponent) Stop() error
- type ComponentID
- type ComponentStatus
- type ComponentType
- type ConfigCallback
- type ConfigCallbackType
- type ConfigHandler
- type ConfigHandlerInfo
- type ConfigHandlerMgr
- type ConfigRegInfo
- type ForcePolicy
- type GCControl
- type IApplication
- type IComponent
- type IComponentKW
- type IConfig
- type ILogger
- type LauncherConfigModel
- type MemorySnapshot
- type NewApplication
- type NewComponent
- type NewComponentKW
- type ProcessType
- type RegComponentInfo
- type SubProcessList
- type TopicSubKey
- type TopicType
Constants ¶
View Source
const ( ComponentBaseInitStatus = iota ComponentInitStatus ComponentStartStatus ComponentStopStatus )
View Source
const ( ComponentPriorityLow = iota ComponentPriorityGeneral ComponentPriorityHigh )
View Source
const (
APPDefaultSignChanSize = 1
)
Variables ¶
This section is empty.
Functions ¶
func GetConfigTemplatePath ¶
func LaunchDaemonApplication ¶
func LaunchDaemonApplication(processType ProcessType, workPath string, launchConf string, newApp NewApplication, appArgs []interface{}, enabledDevMode bool) error
func RegisterComponentInfo ¶
func RegisterComponentInfo(priority int, tpy ComponentType, newComponent NewComponent, newComponentKW NewComponentKW)
func RegisterConfigCallback ¶
func RegisterConfigCallback(cbType ConfigCallbackType, conf IConfig, f ConfigCallback) bool
func RegisterConfigInfo ¶
func RegisterConfigInfo(info ConfigRegInfo)
func SetFrameLoggerInstance ¶
Types ¶
type ApplicationID ¶
type ApplicationID string
type ApplicationProxy ¶
type ApplicationProxy struct {
// contains filtered or unexported fields
}
func GetAppProxy ¶
func GetAppProxy() *ApplicationProxy
func (*ApplicationProxy) GetProcessType ¶
func (t *ApplicationProxy) GetProcessType() ProcessType
func (*ApplicationProxy) IsMainProcess ¶
func (t *ApplicationProxy) IsMainProcess() bool
func (*ApplicationProxy) Pub ¶
func (t *ApplicationProxy) Pub(topic TopicType, args ...interface{}) error
func (*ApplicationProxy) Sub ¶
func (t *ApplicationProxy) Sub(topic TopicType, subKey TopicSubKey, handle pubsub.TopicFunc, preArgs ...interface{}) error
type BaseApplication ¶
type BaseApplication struct {
// contains filtered or unexported fields
}
func (*BaseApplication) AfterStart ¶
func (t *BaseApplication) AfterStart() error
func (*BaseApplication) GetID ¶
func (t *BaseApplication) GetID() ApplicationID
func (*BaseApplication) GetProcessType ¶
func (t *BaseApplication) GetProcessType() ProcessType
func (*BaseApplication) Initialize ¶
func (t *BaseApplication) Initialize(args ...interface{}) error
func (*BaseApplication) Pub ¶
func (t *BaseApplication) Pub(topic TopicType, args ...interface{}) error
func (*BaseApplication) StopBefore ¶
func (t *BaseApplication) StopBefore() error
func (*BaseApplication) Sub ¶
func (t *BaseApplication) Sub(topic TopicType, subKey TopicSubKey, handle pubsub.TopicFunc, preArgs ...interface{}) error
type BaseComponent ¶
type BaseComponent struct {
// contains filtered or unexported fields
}
func (*BaseComponent) GetID ¶
func (t *BaseComponent) GetID() ComponentID
func (*BaseComponent) GetNum ¶
func (t *BaseComponent) GetNum() int
func (*BaseComponent) GetStartTimestamp ¶
func (t *BaseComponent) GetStartTimestamp() int64
func (*BaseComponent) GetStatus ¶
func (t *BaseComponent) GetStatus() ComponentStatus
func (*BaseComponent) GetType ¶
func (t *BaseComponent) GetType() ComponentType
func (*BaseComponent) Initialize ¶
func (t *BaseComponent) Initialize(args ...interface{}) error
func (*BaseComponent) Start ¶
func (t *BaseComponent) Start() error
func (*BaseComponent) Stop ¶
func (t *BaseComponent) Stop() error
type ComponentID ¶
type ComponentID string
type ComponentStatus ¶
type ComponentStatus uint16
type ComponentType ¶
type ComponentType string
type ConfigCallback ¶
type ConfigCallback func()
type ConfigCallbackType ¶
type ConfigCallbackType = uint8
const ( ConfigCallbackTypeCreate ConfigCallbackType = iota ConfigCallbackTypeUpdate ConfigCallbackTypeRemove )
type ConfigHandler ¶
type ConfigHandler struct {
// contains filtered or unexported fields
}
func (*ConfigHandler) GetInfo ¶
func (t *ConfigHandler) GetInfo() (retInfo ConfigHandlerInfo)
func (*ConfigHandler) GetKey ¶
func (t *ConfigHandler) GetKey() string
func (*ConfigHandler) GetPath ¶
func (t *ConfigHandler) GetPath() string
func (*ConfigHandler) GetVersion ¶
func (t *ConfigHandler) GetVersion() int
type ConfigHandlerInfo ¶
type ConfigHandlerMgr ¶
type ConfigHandlerMgr struct {
// contains filtered or unexported fields
}
func GetConfigHandlerMgr ¶
func GetConfigHandlerMgr() *ConfigHandlerMgr
func (*ConfigHandlerMgr) GetConfigHandlerListInfo ¶
func (t *ConfigHandlerMgr) GetConfigHandlerListInfo() (retList []ConfigHandlerInfo)
type ConfigRegInfo ¶
type ForcePolicy ¶
type IApplication ¶
type IApplication interface { Initialize(args ...interface{}) error GetID() ApplicationID GetProcessType() ProcessType Pub(topic TopicType, args ...interface{}) error Sub(topic TopicType, subKey TopicSubKey, handle pubsub.TopicFunc, preArgs ...interface{}) error AfterStart() error StopBefore() error // contains filtered or unexported methods }
type IComponent ¶
type IComponent interface { Initialize(kw IComponentKW) error GetNum() int GetID() ComponentID GetType() ComponentType GetStartTimestamp() int64 Start() error Stop() error // contains filtered or unexported methods }
type IComponentKW ¶
type IComponentKW interface{}
type ILogger ¶
type ILogger interface { SetLevelByDesc(levelDesc string) bool All(v ...interface{}) AllF(format string, v ...interface{}) Debug(v ...interface{}) DebugF(format string, v ...interface{}) Info(v ...interface{}) InfoF(format string, v ...interface{}) Warning(v ...interface{}) WarningF(format string, v ...interface{}) Error(v ...interface{}) ErrorF(format string, v ...interface{}) }
type LauncherConfigModel ¶
type LauncherConfigModel struct { AppID string `json:"app_id"` LogLevel string `json:"log_level"` GCControl GCControl `json:"gc_control"` ConfigInfoList []*configInfoModel `json:"configs"` SubProcessList SubProcessList `json:"sub_process_list"` Components []componentConfigModel `json:"components"` }
type MemorySnapshot ¶
type MemorySnapshot struct { AllocBytes uint64 AllocMBs uint64 TotalAllocMBs uint64 SysMBs uint64 MallocsMbs uint64 HeapAllocMBs uint64 HeapSysMbs uint64 }
func GetInitialMemorySnapshot ¶
func GetInitialMemorySnapshot() MemorySnapshot
type NewApplication ¶
type NewApplication func() IApplication
type NewComponent ¶
type NewComponent func() IComponent
type NewComponentKW ¶
type NewComponentKW func() IComponentKW
type ProcessType ¶
type ProcessType int
const ( MainProcessType ProcessType = iota + 1 SubProcessType )
type RegComponentInfo ¶
type RegComponentInfo struct { Priority int Tpy ComponentType NewComponent NewComponent NewComponentKW NewComponentKW }
type SubProcessList ¶
type TopicSubKey ¶
type TopicSubKey interface{}
Click to show internal directories.
Click to hide internal directories.