Documentation ¶
Index ¶
Constants ¶
View Source
const ( ReConnectionLimitFieldName = "db.re_connection.limit" ReConnectionLimitDefault = uint16(10) )
Variables ¶
View Source
var Component = &app.Component{ Dependencies: app.Components{ logger.Component, configurator.Component, info.Component, }, Constructor: func(container container.Container) error { return container.Provides( NewConfig, NewReConfigurationWithConfigurator, func(reConfiguration *ReConfiguration) Limiter { return reConfiguration }, ) }, BindFlags: func(flagSet *pflag.FlagSet, container container.Container) error { return container.Invoke(func(config *Config) { flagSet.Uint16Var( &config.ReConnectionLimit, ReConnectionLimitFieldName, ReConnectionLimitDefault, "the maximum number of reconnection attempts, if 0 then unlimited", ) }) }, Run: func(c container.Container) error { limiter, err := container.Get[*ReConfiguration](c) if err != nil { return err } reConfiguration, err := container.Get[configurator.ReConfiguration](c) if err != nil { return err } informer, err := container.Get[logger.Informer](c) if err != nil { return err } reConfiguration.Registration(limiter) informer.Info("data_base.re_connection.limiter: registration in the reConfigurator") info, err := container.Get[info.Info](c) if err != nil { return err } config, err := container.Get[*Config](c) if err != nil { return err } info.Registration("data_base.re_connection.limiter", config) return nil }, }
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ReConnectionLimit uint16
}
func Configuration ¶
func Configuration(config *Config, configurator configurator.Configurator) *Config
type ReConfiguration ¶
type ReConfiguration struct {
// contains filtered or unexported fields
}
func NewReConfiguration ¶
func NewReConfiguration(logger logger.Logger, config *Config) *ReConfiguration
func NewReConfigurationWithConfigurator ¶
func NewReConfigurationWithConfigurator(logger logger.Logger, config *Config, configurator configurator.Configurator) *ReConfiguration
func (*ReConfiguration) Limiter ¶
func (reConfiguration *ReConfiguration) Limiter() Limiter
func (*ReConfiguration) Next ¶
func (reConfiguration *ReConfiguration) Next() bool
func (*ReConfiguration) ReConfiguration ¶
func (reConfiguration *ReConfiguration) ReConfiguration(configurator configurator.Configurator) error
func (*ReConfiguration) Reset ¶
func (reConfiguration *ReConfiguration) Reset()
Click to show internal directories.
Click to hide internal directories.