Documentation ¶
Index ¶
- Constants
- Variables
- type AppInitFunc
- type Bootstrapper
- type BootstrapperConfigFunc
- func WithConfigMaskedKeys(configMaskedKeys []string) BootstrapperConfigFunc
- func WithConfigSourcer(configSourcer ConfigSourcer) BootstrapperConfigFunc
- func WithLoggingFields(loggingFields LogFields) BootstrapperConfigFunc
- func WithLoggingInitFunc(loggingInitFunc LoggingInitFunc) BootstrapperConfigFunc
- func WithRunnerOptions(configs ...RunnerConfigFunc) BootstrapperConfigFunc
- type Config
- type ConfigSourcer
- type FileParser
- type FileSystem
- type Finalizer
- type Health
- type Initializer
- type InitializerConfigFunc
- type InitializerFunc
- type LogFields
- type LogLevel
- type Logger
- type LoggingInitFunc
- type ParallelInitializer
- type Process
- type ProcessConfigFunc
- type ProcessContainer
- type ReplayLogger
- type RunnerConfigFunc
- type ServiceContainer
- type ServiceInitializerFunc
- type TagModifier
Constants ¶
const ( LevelDebug = log.LevelDebug LevelError = log.LevelError LevelFatal = log.LevelFatal LevelInfo = log.LevelInfo LevelWarning = log.LevelWarning )
Variables ¶
var ( NewConfig = config.NewConfig NewDefaultTagSetter = config.NewDefaultTagSetter NewDirectorySourcer = config.NewDirectorySourcer NewEnvSourcer = config.NewEnvSourcer NewEnvTagPrefixer = config.NewEnvTagPrefixer NewFlagSourcer = config.NewFlagSourcer NewFlagTagPrefixer = config.NewFlagTagPrefixer NewFlagTagSetter = config.NewFlagTagSetter NewFileSourcer = config.NewFileSourcer NewFileTagPrefixer = config.NewFileTagPrefixer NewFileTagSetter = config.NewFileTagSetter NewGlobSourcer = config.NewGlobSourcer NewMultiSourcer = config.NewMultiSourcer NewOptionalDirectorySourcer = config.NewOptionalDirectorySourcer NewOptionalFileSourcer = config.NewOptionalFileSourcer NewTestEnvSourcer = config.NewTestEnvSourcer NewTOMLFileSourcer = config.NewTOMLFileSourcer NewYAMLFileSourcer = config.NewYAMLFileSourcer ParseTOML = config.ParseTOML ParseYAML = config.ParseYAML WithDirectorySourcerFS = config.WithDirectorySourcerFS WithFileSourcerFS = config.WithFileSourcerFS WithGlobSourcerFS = config.WithGlobSourcerFS )
var ( EmergencyLogger = log.EmergencyLogger LogEmergencyError = log.LogEmergencyError LogEmergencyErrors = log.LogEmergencyErrors NewNilLogger = log.NewNilLogger NewReplayAdapter = log.NewReplayAdapter NewRollupAdapter = log.NewRollupAdapter )
var ( NewHealth = process.NewHealth NewParallelInitializer = process.NewParallelInitializer NewProcessContainer = process.NewProcessContainer WithHealthCheckInterval = process.WithHealthCheckInterval WithInitializerName = process.WithInitializerName WithInitializerLogFields = process.WithInitializerLogFields WithInitializerTimeout = process.WithInitializerTimeout WithPriority = process.WithPriority WithProcessInitTimeout = process.WithProcessInitTimeout WithProcessName = process.WithProcessName WithProcessLogFields = process.WithProcessLogFields WithProcessShutdownTimeout = process.WithProcessShutdownTimeout WithProcessStartTimeout = process.WithProcessStartTimeout WithShutdownTimeout = process.WithShutdownTimeout WithSilentExit = process.WithSilentExit WithStartTimeout = process.WithStartTimeout )
var ( NewServiceContainer = service.NewServiceContainer Overlay = service.Overlay )
Functions ¶
This section is empty.
Types ¶
type AppInitFunc ¶
type AppInitFunc func(ProcessContainer, ServiceContainer) error
AppInitFunc is an program entrypoint called after performing initial configuration loading, sanity checks, and setting up loggers. This function should register initializers and processes and inject values into the service container where necessary.
type Bootstrapper ¶
type Bootstrapper struct {
// contains filtered or unexported fields
}
Bootstrapper wraps the entrypoint to the program.
func NewBootstrapper ¶
func NewBootstrapper( name string, initFunc AppInitFunc, bootstrapperConfigs ...BootstrapperConfigFunc, ) *Bootstrapper
NewBootstrapper creates an entrypoint to the program with the given configs.
func (*Bootstrapper) Boot ¶
func (bs *Bootstrapper) Boot() int
Boot will initialize services and return a status code. This method does not return in any meaningful way (it blocks until the associated process runner has completed).
func (*Bootstrapper) BootAndExit ¶
func (bs *Bootstrapper) BootAndExit()
BootAndExit calls Boot and sets the program return code on halt. This method does not return.
type BootstrapperConfigFunc ¶
type BootstrapperConfigFunc func(*bootstrapperConfig)
BootstrapperConfigFunc is a function used to configure an instance of a Bootstrapper.
func WithConfigMaskedKeys ¶
func WithConfigMaskedKeys(configMaskedKeys []string) BootstrapperConfigFunc
WithConfigMaskedKeys sets the keys that are redacted when printed by the config logger.
func WithConfigSourcer ¶
func WithConfigSourcer(configSourcer ConfigSourcer) BootstrapperConfigFunc
WithConfigSourcer sets the source that should be used for populating config structs.
func WithLoggingFields ¶
func WithLoggingFields(loggingFields LogFields) BootstrapperConfigFunc
WithLoggingFields sets additional fields sent with every log message.
func WithLoggingInitFunc ¶
func WithLoggingInitFunc(loggingInitFunc LoggingInitFunc) BootstrapperConfigFunc
WithLoggingInitFunc sets the function that initializes logging.
func WithRunnerOptions ¶
func WithRunnerOptions(configs ...RunnerConfigFunc) BootstrapperConfigFunc
WithRunnerOptions passes RunnerConfigFuncs to the runner created by Boot.
type ConfigSourcer ¶
type FileParser ¶
type FileParser = config.FileParser
type FileSystem ¶ added in v1.1.2
type FileSystem = config.FileSystem
type Initializer ¶
type Initializer = process.Initializer
type InitializerConfigFunc ¶
type InitializerConfigFunc = process.InitializerConfigFunc
type InitializerFunc ¶
type InitializerFunc = process.InitializerFunc
func WrapServiceInitializerFunc ¶
func WrapServiceInitializerFunc(container ServiceContainer, f ServiceInitializerFunc) InitializerFunc
WrapServiceInitializerFunc creates an InitializerFunc from a ServiceInitializerFunc and a container.
type LoggingInitFunc ¶
LoggingInitFunc creates a factory from a config object.
type ParallelInitializer ¶
type ParallelInitializer = process.ParallelInitializer
type ProcessConfigFunc ¶
type ProcessConfigFunc = process.ProcessConfigFunc
type ProcessContainer ¶
type ProcessContainer = process.ProcessContainer
type ReplayLogger ¶
type ReplayLogger = log.ReplayLogger
type RunnerConfigFunc ¶
type RunnerConfigFunc = process.RunnerConfigFunc
type ServiceContainer ¶
type ServiceContainer = service.ServiceContainer
type ServiceInitializerFunc ¶
type ServiceInitializerFunc func(config Config, container ServiceContainer) error
ServiceInitializerFunc is an InitializerFunc with a service container argument.
type TagModifier ¶
type TagModifier = config.TagModifier