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, reConfiguration.Component, }, Constructor: app.Constructor(func(container container.Container) error { return container.Provides( NewConfig, NewReConfigurationWithConfigurator, func(reConfiguration *ReConfiguration) Limiter { return reConfiguration }, ) }), BindFlags: app.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: app.Run(func(container container.Container) error { return container.Invoke(func( limiter *ReConfiguration, reConfiguration reConfiguration.ReConfiguration, informer logger.Informer, config *Config, ) { reConfiguration.Registration(limiter) informer.Info("data_base.limiter: registration in the reConfigurator") }) }), }
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.