Documentation
¶
Index ¶
- Constants
- func RegisterBootstrapFlags(fs *flag.FlagSet)
- type Application
- func (app *Application) GetHost() string
- func (app *Application) GetName() string
- func (app *Application) GetVersion() string
- func (app *Application) LoadBootstrapConfig() error
- func (app *Application) Run() error
- func (app *Application) SetConfigPath(path string) *Application
- func (app *Application) SetPublishDefaultApp(enabled bool) *Application
- type ConfigManager
- type HealthChecker
Constants ¶
const ( DefaultShutdownTimeout = 30 * time.Second DefaultHealthCheckInterval = 30 * time.Second DefaultCircuitBreakerThreshold = 5 DefaultCircuitBreakerTimeout = 60 * time.Second )
Default configuration constants
Variables ¶
This section is empty.
Functions ¶
func RegisterBootstrapFlags ¶ added in v1.6.0
RegisterBootstrapFlags registers boot compatibility flags on the provided flag set. Host processes that parse flags before calling Run should invoke this explicitly. The registration is idempotent for the process-wide default FlagSet.
Types ¶
type Application ¶ added in v1.2.3
type Application struct {
// contains filtered or unexported fields
}
Application is an optional bootstrap shell around Lynx core. It owns process-level concerns such as signal handling, startup sequencing, and Kratos integration. It should not be treated as part of the plugin orchestration core itself.
func NewApplication ¶ added in v1.2.3
func NewApplication(wire wireApp, plugins ...plugins.Plugin) *Application
NewApplication creates a bootstrap shell around the given wire function and optional plugins. It returns nil if wire is nil. By default the created app is published as the process-wide default; see SetPublishDefaultApp to opt out.
func (*Application) GetHost ¶ added in v1.2.3
func (app *Application) GetHost() string
GetHost returns lynx.application.host, or "localhost" if unset.
func (*Application) GetName ¶ added in v1.2.3
func (app *Application) GetName() string
GetName returns lynx.application.name, or "lynx" if unset.
func (*Application) GetVersion ¶ added in v1.2.3
func (app *Application) GetVersion() string
GetVersion returns lynx.application.version, or "unknown" if unset.
func (*Application) LoadBootstrapConfig ¶ added in v1.2.3
func (app *Application) LoadBootstrapConfig() error
LoadBootstrapConfig loads, validates, and stores the local bootstrap config. The path is resolved (in order) from the instance path, the config manager, the -conf flag, then the manager's default. It also registers the cleanup that closes the config on shutdown.
func (*Application) Run ¶ added in v1.2.3
func (app *Application) Run() error
Run loads configuration, starts the Lynx core and all plugins, runs the Kratos app, and blocks until shutdown. It installs signal handling and always performs graceful shutdown (and panic recovery) before returning.
func (*Application) SetConfigPath ¶ added in v1.6.0
func (app *Application) SetConfigPath(path string) *Application
SetConfigPath binds a bootstrap config path to this Application instance. Instance-scoped paths take precedence over process-wide config manager state.
func (*Application) SetPublishDefaultApp ¶ added in v1.6.0
func (app *Application) SetPublishDefaultApp(enabled bool) *Application
SetPublishDefaultApp controls whether Run publishes the created app as the process-wide default Lynx application instance.
type ConfigManager ¶ added in v1.2.3
type ConfigManager struct {
// contains filtered or unexported fields
}
ConfigManager manages application configuration paths
func GetConfigManager ¶ added in v1.2.3
func GetConfigManager() *ConfigManager
GetConfigManager returns singleton configuration manager instance
func (*ConfigManager) GetConfigPath ¶ added in v1.2.3
func (cm *ConfigManager) GetConfigPath() string
GetConfigPath gets configuration path
func (*ConfigManager) GetDefaultConfigPath ¶ added in v1.2.3
func (cm *ConfigManager) GetDefaultConfigPath() string
GetDefaultConfigPath returns LYNX_CONFIG_PATH if set, otherwise "./configs".
func (*ConfigManager) IsConfigPathSet ¶ added in v1.2.3
func (cm *ConfigManager) IsConfigPathSet() bool
IsConfigPathSet checks if configuration path is set
func (*ConfigManager) SetConfigPath ¶ added in v1.2.3
func (cm *ConfigManager) SetConfigPath(path string)
SetConfigPath sets configuration path
type HealthChecker ¶ added in v1.2.3
type HealthChecker struct {
// contains filtered or unexported fields
}
HealthChecker provides application health monitoring
func (*HealthChecker) IsHealthy ¶ added in v1.2.3
func (hc *HealthChecker) IsHealthy() bool
IsHealthy returns the current health status
func (*HealthChecker) Run ¶ added in v1.2.3
func (hc *HealthChecker) Run()
Run starts the health checker
func (*HealthChecker) Stop ¶ added in v1.2.3
func (hc *HealthChecker) Stop()
Stop stops the health checker