Documentation ¶
Index ¶
- Constants
- Variables
- func GetConfigTemplatePath(workPath string) string
- func LaunchDaemonApplication(processType ProcessType, workPath string, launchConf string, ...) error
- func MemorySizeToString(size uint64) string
- func PublishEventMessage(event EventType, args ...interface{}) error
- func RegisterComponentInfo(priority int, tpy ComponentType, newComponent NewComponent, ...)
- func RegisterConfigCallback(cbType ConfigCallbackType, confHandler IConfigHandler, f ConfigCallback) bool
- func RegisterConfigInfo(info ConfigRegInfo)
- func SetFrameLoggerInstance(logger ILogger) error
- func SubscribeEventMessage(event EventType, subKey EventSubKey, handle pubsub.TopicFunc, ...) error
- func UpdateMemoryUsageLimitBytes(limitBytes int64)
- type BaseComponent
- func (t *BaseComponent) GetID() ComponentID
- func (t *BaseComponent) GetIndex() int
- 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 ConfigRegInfo
- type ConfigWatcher
- type ConfigWatcherInfo
- type ConfigWatcherMgr
- type EventSubKey
- type EventType
- type ForcePolicy
- type GCControl
- type IComponent
- type IComponentKW
- type IConfigHandler
- type ILogger
- type LauncherConfigModel
- type MemorySnapshot
- type NewComponent
- type NewComponentKW
- type NewConfigHandlerFunc
- type ProcessType
- type RegComponentInfo
- type SubProcessList
Constants ¶
View Source
const ( ComponentBaseInitStatus = iota ComponentInitStatus ComponentStartStatus ComponentStopStatus )
View Source
const ( ComponentPriorityLow = iota ComponentPriorityGeneral ComponentPriorityHigh )
View Source
const ( KBSize = 1024 MBSize = KBSize * 1024 GBSize = MBSize * 1024 )
Variables ¶
View Source
var (
ErrInvalidEventMsgInst = errors.New("invalid eventMessageMgr instance")
)
Functions ¶
func GetConfigTemplatePath ¶
func LaunchDaemonApplication ¶
func LaunchDaemonApplication(processType ProcessType, workPath string, launchConf string, appArgs []interface{}, enabledDevMode bool) error
func MemorySizeToString ¶ added in v1.0.4
func PublishEventMessage ¶ added in v1.0.4
func RegisterComponentInfo ¶
func RegisterComponentInfo(priority int, tpy ComponentType, newComponent NewComponent, newComponentKW NewComponentKW)
func RegisterConfigCallback ¶
func RegisterConfigCallback(cbType ConfigCallbackType, confHandler IConfigHandler, f ConfigCallback) bool
func RegisterConfigInfo ¶
func RegisterConfigInfo(info ConfigRegInfo)
func SetFrameLoggerInstance ¶
func SubscribeEventMessage ¶ added in v1.0.4
func SubscribeEventMessage(event EventType, subKey EventSubKey, handle pubsub.TopicFunc, preArgs ...interface{}) error
func UpdateMemoryUsageLimitBytes ¶ added in v1.0.4
func UpdateMemoryUsageLimitBytes(limitBytes int64)
Types ¶
type BaseComponent ¶
type BaseComponent struct {
// contains filtered or unexported fields
}
func (*BaseComponent) GetID ¶
func (t *BaseComponent) GetID() ComponentID
func (*BaseComponent) GetIndex ¶ added in v1.0.4
func (t *BaseComponent) GetIndex() int
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 ConfigRegInfo ¶
type ConfigWatcher ¶ added in v1.0.2
type ConfigWatcher struct {
// contains filtered or unexported fields
}
func (*ConfigWatcher) GetInfo ¶ added in v1.0.2
func (t *ConfigWatcher) GetInfo() (retInfo ConfigWatcherInfo)
func (*ConfigWatcher) GetKey ¶ added in v1.0.2
func (t *ConfigWatcher) GetKey() string
func (*ConfigWatcher) GetPath ¶ added in v1.0.2
func (t *ConfigWatcher) GetPath() string
func (*ConfigWatcher) GetVersion ¶ added in v1.0.2
func (t *ConfigWatcher) GetVersion() int
type ConfigWatcherInfo ¶ added in v1.0.2
type ConfigWatcherMgr ¶ added in v1.0.2
type ConfigWatcherMgr struct {
// contains filtered or unexported fields
}
func GetConfigWatcherMgr ¶ added in v1.0.2
func GetConfigWatcherMgr() *ConfigWatcherMgr
func (*ConfigWatcherMgr) GetConfigWatcherListInfo ¶ added in v1.0.2
func (t *ConfigWatcherMgr) GetConfigWatcherListInfo() (retList []ConfigWatcherInfo)
type EventSubKey ¶ added in v1.0.4
type EventSubKey interface{}
type ForcePolicy ¶
type GCControl ¶
type GCControl struct { Percent int `json:"percent"` DisableDefaultGC bool `json:"disable_default_gc"` MemoryUsageLimitBytes int64 `json:"memory_usage_limit_bytes"` EnableForce bool `json:"enable_force"` ForcePolicy struct { IntervalSecondS int `json:"interval_seconds"` MemPeak int `json:"mem_peak"` } `json:"force_policy"` }
type IComponent ¶
type IComponent interface { Initialize(kw IComponentKW) error GetIndex() int GetID() ComponentID GetType() ComponentType Start() error Stop() error // contains filtered or unexported methods }
type IComponentKW ¶
type IComponentKW interface{}
type IConfigHandler ¶ added in v1.0.2
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"` PidFileDirPath string `json:"pid_file_dir_path"` 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 {
// contains filtered or unexported fields
}
func GetInitialMemorySnapshot ¶
func GetInitialMemorySnapshot() *MemorySnapshot
func NewMemorySnapshot ¶ added in v1.0.4
func NewMemorySnapshot() *MemorySnapshot
func (*MemorySnapshot) GetStats ¶ added in v1.0.4
func (t *MemorySnapshot) GetStats() runtime.MemStats
func (*MemorySnapshot) String ¶ added in v1.0.4
func (t *MemorySnapshot) String() string
type NewComponent ¶
type NewComponent func() IComponent
type NewComponentKW ¶
type NewComponentKW func() IComponentKW
type NewConfigHandlerFunc ¶ added in v1.0.2
type NewConfigHandlerFunc func() IConfigHandler
type ProcessType ¶
type ProcessType int
const ( MainProcessType ProcessType = iota + 1 SubProcessType )
func GetCurrentProcessType ¶ added in v1.0.4
func GetCurrentProcessType() ProcessType
type RegComponentInfo ¶
type RegComponentInfo struct { Priority int Tpy ComponentType NewComponent NewComponent NewComponentKW NewComponentKW }
type SubProcessList ¶
Click to show internal directories.
Click to hide internal directories.