Versions in this module Expand all Collapse all v1 v1.0.1 Mar 12, 2026 v1.0.0 Mar 11, 2026 Changes in this version + const CMDSPLIT + const SPLITCHAR + const STRINGSYM + const TRANSLATE + var Branch = "unknown" + var BuildMode = "DEBUG" + var BuildTime = "unknown" + var Commit = "unknown" + var ConfigVer = "unknown" + var Version = "v0.0.0" + func AtappAddModule[ModuleType AppModuleImpl](app AppImpl, module ModuleType) error + func AtappGetModule[ModuleType AppModuleImpl](app AppImpl) ModuleType + func ExpandExpression(input string) string + func GetEnvUpperKey(key string) string + func LoadConfigFromEnvironemnt(envPrefix string, configPb proto.Message, logger *log.Logger, ...) (bool, error) + func LoadConfigFromOriginData(originData interface{}, prefixPath string, configPb proto.Message, ...) (err error) + func LoadConfigFromOriginDataByPath(logger *log.Logger, originData interface{}, target proto.Message, ...) (err error) + func LoadConfigFromYaml(configPath string, prefixPath string, configPb proto.Message, ...) (yamlData map[string]interface{}, err error) + func LoadConfigOriginYaml(configPath string) (yamlData map[string]interface{}, err error) + func LoadDefaultConfigMessageFields(configPb proto.Message, logger *log.Logger, dumpExistedSet *ConfigExistedIndex, ...) error + func LoadLogCategoryConfigFromEnvironemnt(envPrefix string, logCategoryPb *atframe_protocol.AtappLogCategory, ...) bool + func ParsePlainMessage(yamlData map[string]interface{}, msg proto.Message, logger *log.Logger) error + func PrintBuildInfo() + func RegisterBuildInfoCommand() + func SetBuildInfo(version, gitCommit, gitBranch, buildTime, cfgVersion, buildMode string) + type AppActionData struct + App AppImpl + MessageData []byte + PrivateData interface{} + type AppActionSender struct + type AppConfig struct + AppName string + AppVersion string + BuildVersion string + ConfigFile string + ConfigLog *atframe_protocol.AtappLog + ConfigOriginData interface{} + ConfigPb *atframe_protocol.AtappConfigure + CrashOutputFile string + ExecutePath string + HashCode string + PidFile string + StartupErrorFile string + StartupLog []string + type AppFlag uint64 + const AppFlagDestroying + const AppFlagInCallback + const AppFlagInTick + const AppFlagInitialized + const AppFlagInitializing + const AppFlagRunning + const AppFlagStopped + const AppFlagStopping + const AppFlagTimeout + type AppImpl interface + AddModule func(typeInst lu.TypeID, module AppModuleImpl) error + CheckFlag func(flag AppFlag) bool + GetAppContext func() context.Context + GetAppIdentity func() string + GetAppName func() string + GetAppVersion func() string + GetBuildVersion func() string + GetConfig func() *AppConfig + GetConfigFile func() string + GetDefaultLogger func() *log.Logger + GetHashCode func() string + GetId func() uint64 + GetLogger func(index int) *log.Logger + GetModule func(typeInst lu.TypeID) AppModuleImpl + GetSysNow func() time.Time + GetTypeId func() uint64 + GetTypeName func() string + Init func(arguments []string) error + IsClosed func() bool + IsClosing func() bool + IsInited func() bool + IsRunning func() bool + LoadConfig func(configFile string, configurePrefixPath string, loadEnvironemntPrefix string, ...) error + LoadConfigByPath func(target proto.Message, configurePrefixPath string, loadEnvironemntPrefix string, ...) error + LoadLogConfigByPath func(target *atframe_protocol.AtappLog, configurePrefixPath string, ...) error + PushAction func(callback func(action *AppActionData) error, message_data []byte, ...) error + Reload func() error + Run func(arguments []string) error + RunOnce func(tickTimer *time.Ticker) error + SendMessage func(targetId uint64, msgType int32, data []byte) error + SendMessageByName func(targetName string, msgType int32, data []byte) error + SetEventHandler func(eventType string, handler EventHandler) + SetFlag func(flag AppFlag, value bool) bool + Stop func() error + TriggerEvent func(eventType string, args *AppActionSender) int + func CreateAppInstance() AppImpl + type AppInstance struct + func (app *AppInstance) AddModule(typeInst lu.TypeID, module AppModuleImpl) error + func (app *AppInstance) CheckFlag(flag AppFlag) bool + func (app *AppInstance) GetAppContext() context.Context + func (app *AppInstance) GetAppIdentity() string + func (app *AppInstance) GetAppName() string + func (app *AppInstance) GetAppVersion() string + func (app *AppInstance) GetBuildVersion() string + func (app *AppInstance) GetConfig() *AppConfig + func (app *AppInstance) GetConfigFile() string + func (app *AppInstance) GetDefaultLogger() *log.Logger + func (app *AppInstance) GetHashCode() string + func (app *AppInstance) GetId() uint64 + func (app *AppInstance) GetLogger(index int) *log.Logger + func (app *AppInstance) GetModule(typeInst lu.TypeID) AppModuleImpl + func (app *AppInstance) GetSysNow() time.Time + func (app *AppInstance) GetTypeId() uint64 + func (app *AppInstance) GetTypeName() string + func (app *AppInstance) Init(arguments []string) error + func (app *AppInstance) InitLog(config *atframe_protocol.AtappLog) (*AppLog, error) + func (app *AppInstance) IsClosed() bool + func (app *AppInstance) IsClosing() bool + func (app *AppInstance) IsInited() bool + func (app *AppInstance) IsRunning() bool + func (app *AppInstance) LoadConfig(configFile string, configurePrefixPath string, loadEnvironemntPrefix string, ...) (err error) + func (app *AppInstance) LoadConfigByPath(target proto.Message, configurePrefixPath string, loadEnvironemntPrefix string, ...) error + func (app *AppInstance) LoadLogConfigByPath(target *atframe_protocol.AtappLog, configurePrefixPath string, ...) error + func (app *AppInstance) LoadOriginConfigData(configFile string) (err error) + func (app *AppInstance) MakeAction(callback func(action *AppActionData) error, message_data []byte, ...) *AppActionSender + func (app *AppInstance) PushAction(callback func(action *AppActionData) error, message_data []byte, ...) error + func (app *AppInstance) Reload() error + func (app *AppInstance) Run(arguments []string) error + func (app *AppInstance) RunCommand(arguments []string) error + func (app *AppInstance) RunOnce(tickTimer *time.Ticker) error + func (app *AppInstance) SendMessage(targetId uint64, msgType int32, data []byte) error + func (app *AppInstance) SendMessageByName(targetName string, msgType int32, data []byte) error + func (app *AppInstance) SetEventHandler(eventType string, handler EventHandler) + func (app *AppInstance) SetFlag(flag AppFlag, value bool) bool + func (app *AppInstance) Stop() error + func (app *AppInstance) TriggerEvent(eventType string, args *AppActionSender) int + type AppLog struct + type AppMode int + const AppModeCustom + const AppModeHelp + const AppModeInfo + const AppModeReload + const AppModeStart + const AppModeStop + type AppModuleBase struct + func CreateAppModuleBase(owner AppImpl) AppModuleBase + func (m *AppModuleBase) Active() + func (m *AppModuleBase) Cleanup() + func (m *AppModuleBase) Disable() + func (m *AppModuleBase) Enable() + func (m *AppModuleBase) GetApp() AppImpl + func (m *AppModuleBase) GetSysNow() time.Time + func (m *AppModuleBase) IsActived() bool + func (m *AppModuleBase) IsEnabled() bool + func (m *AppModuleBase) OnBind() + func (m *AppModuleBase) OnUnbind() + func (m *AppModuleBase) Ready() + func (m *AppModuleBase) Reload() error + func (m *AppModuleBase) Setup(_initCtx context.Context) error + func (m *AppModuleBase) SetupLog(_initCtx context.Context) error + func (m *AppModuleBase) Stop() (bool, error) + func (m *AppModuleBase) Tick(_initCtx context.Context) bool + func (m *AppModuleBase) Timeout() + func (m *AppModuleBase) Unactive() + type AppModuleImpl interface + Active func() + Cleanup func() + Disable func() + Enable func() + GetApp func() AppImpl + Init func(parent context.Context) error + IsActived func() bool + IsEnabled func() bool + Name func() string + OnBind func() + OnUnbind func() + Ready func() + Reload func() error + Setup func(parent context.Context) error + SetupLog func(parent context.Context) error + Stop func() (bool, error) + Tick func(parent context.Context) bool + Timeout func() + Unactive func() + type BuildInfo struct + BuildMode string + BuildTime string + ConfigVersion string + GitBranch string + GitCommit string + Version string + func GetBuildInfo() BuildInfo + func (b BuildInfo) ToString() string + type CommandHandler func(*AppInstance, string, []string) error + type CommandManager struct + func NewCommandManager() *CommandManager + func (cm *CommandManager) ExecuteCommand(app *AppInstance, command string, args []string) error + func (cm *CommandManager) ListCommands() []string + func (cm *CommandManager) RegisterCommand(name string, handler CommandHandler) + type ConfigExistedIndex struct + ExistedSet map[string]struct{} + MapKeyIndex map[string]int + func CreateConfigExistedIndex() *ConfigExistedIndex + func (i *ConfigExistedIndex) MutableExistedSet() map[string]struct{} + func (i *ConfigExistedIndex) MutableMapKeyIndex() map[string]int + type EventHandler func(*AppInstance, *AppActionSender) int + type LoadConfigOptions struct + ReorderListIndexByField string + type Message struct + Data []byte + Metadata map[string]string + Sequence uint64 + SourceId uint64 + SourceName string + Type int32