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 Health
- type Initializer
- type InitializerConfigFunc
- type InitializerFunc
- type LogFields
- type LogLevel
- type Logger
- type LoggingInitFunc
- type ParallelInitializer
- type Process
- type ProcessConfigFunc
- type ProcessContainer
- type RunnerConfigFunc
- type ServiceContainer
- type ServiceInitializerFunc
- type TagModifier
Constants ¶
const ( LevelFatal = logging.LevelFatal LevelError = logging.LevelError LevelWarning = logging.LevelWarning LevelInfo = logging.LevelInfo LevelDebug = logging.LevelDebug )
Variables ¶
var ( NewConfig = config.NewConfig NewLoggingConfig = config.NewLoggingConfig NewEnvSourcer = config.NewEnvSourcer NewFileSourcer = config.NewFileSourcer NewGlobSourcer = zubrin.NewGlobSourcer NewOptionalFileSourcer = config.NewOptionalFileSourcer NewDirectorySourcer = config.NewDirectorySourcer NewOptionalDirectorySourcer = config.NewOptionalDirectorySourcer NewYAMLFileSourcer = config.NewYAMLFileSourcer NewTOMLFileSourcer = config.NewTOMLFileSourcer NewMultiSourcer = config.NewMultiSourcer NewEnvTagPrefixer = config.NewEnvTagPrefixer NewFileTagPrefixer = config.NewFileTagPrefixer NewDefaultTagSetter = config.NewDefaultTagSetter )
var ( NewNilLogger = logging.NewNilLogger NewReplayAdapter = logging.NewReplayAdapter NewRollupAdapter = logging.NewRollupAdapter LogEmergencyError = logging.LogEmergencyError LogEmergencyErrors = logging.LogEmergencyErrors EmergencyLogger = logging.EmergencyLogger )
var ( NewParallelInitializer = process.NewParallelInitializer WithStartTimeout = process.WithStartTimeout WithHealthCheckBackoff = process.WithHealthCheckBackoff WithShutdownTimeout = process.WithShutdownTimeout WithInitializerName = process.WithInitializerName WithProcessName = process.WithProcessName WithPriority = process.WithPriority WithSilentExit = process.WithSilentExit WithInitializerTimeout = process.WithInitializerTimeout WithProcessInitTimeout = process.WithProcessInitTimeout WithProcessStartTimeout = process.WithProcessStartTimeout WithProcessShutdownTimeout = process.WithProcessShutdownTimeout )
var NewServiceContainer = service.NewContainer
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 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 RunnerConfigFunc ¶
type RunnerConfigFunc = process.RunnerConfigFunc
type 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
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
base
|
|
grpc/internal
Package internal is a generated protocol buffer package.
|
Package internal is a generated protocol buffer package. |
examples
|
|
grpc
Package main is a generated protocol buffer package.
|
Package main is a generated protocol buffer package. |
multi-grpc
Package main is a generated protocol buffer package.
|
Package main is a generated protocol buffer package. |
multi-process/grpc
Package grpc is a generated protocol buffer package.
|
Package grpc is a generated protocol buffer package. |