Documentation ¶
Index ¶
- Constants
- Variables
- func ReadBytesLogger(logger logger.Logger) client.MiddlewareFunc
- func ReadBytesMetric(informer logger.Informer, metric *metric.Metric) client.MiddlewareFunc
- func ReadTimeout(config *ReadConfig, informer logger.Informer) client.MiddlewareFunc
- func ReadTimeoutComponentBindFlags(flagSet *pflag.FlagSet, container container.Container) error
- func WriteBytesLogger(logger logger.Logger) client.MiddlewareFunc
- func WriteBytesMetric(informer logger.Informer, metric *metric.Metric) client.MiddlewareFunc
- func WriteTimeout(config *WriteConfig, informer logger.Informer) client.MiddlewareFunc
- func WriteTimeoutComponentBindFlags(flagSet *pflag.FlagSet, container container.Container) error
- type ReadConfig
- type WriteConfig
Constants ¶
View Source
const ( WriteTimeoutFieldName = "client.socket.timeout.write" ReadTimeoutFieldName = "client.socket.timeout.read" WriteTimeoutDefault = 10 * time.Second ReadTimeoutDefault = 10 * time.Second )
Variables ¶
View Source
var ( ReadBytesLoggerComponent = &app.Component{ Dependencies: app.Components{ logger.Component, client.Component, }, Run: app.Run(func(container container.Container) error { return container.Invoke(func(socketClient client.Client, logger logger.Logger) { socketClient.Use(ReadBytesLogger(logger)) }) }), } ReadBytesMetricComponent = &app.Component{ Dependencies: app.Components{ logger.Component, client.Component, metric.Component, }, Run: app.Run(func(container container.Container) error { return container.Invoke(func(socketClient client.Client, logger logger.Logger, metric *metric.Metric) { socketClient.Use(ReadBytesMetric(logger, metric)) }) }), } ReadTimeoutComponent = &app.Component{ Dependencies: app.Components{ logger.Component, configurator.Component, client.Component, }, Constructor: app.Constructor(func(container container.Container) error { return container.Provide(NewReadConfig) }), BindFlags: app.BindFlags(ReadTimeoutComponentBindFlags), Run: app.Run(func(container container.Container) error { return container.Invoke(func(socketClient client.Client, config *ReadConfig, logger logger.Logger, configurator configurator.Configurator) { socketClient.Use(ReadTimeout(ReadConfigConfiguration(config, configurator), logger)) }) }), } ReadComponent = &app.Component{ Dependencies: app.Components{ ReadBytesLoggerComponent, ReadBytesMetricComponent, ReadTimeoutComponent, }, } WriteBytesLoggerComponent = &app.Component{ Dependencies: app.Components{ logger.Component, client.Component, }, Run: app.Run(func(container container.Container) error { return container.Invoke(func(socketClient client.Client, logger logger.Logger) { socketClient.Use(WriteBytesLogger(logger)) }) }), } WriteBytesMetricComponent = &app.Component{ Dependencies: app.Components{ logger.Component, client.Component, metric.Component, }, Run: app.Run(func(container container.Container) error { return container.Invoke(func(socketClient client.Client, logger logger.Logger, metric *metric.Metric) { socketClient.Use(WriteBytesMetric(logger, metric)) }) }), } WriteTimeoutComponent = &app.Component{ Dependencies: app.Components{ logger.Component, configurator.Component, client.Component, }, Constructor: app.Constructor(func(container container.Container) error { return container.Provide(NewWriteConfig) }), BindFlags: app.BindFlags(WriteTimeoutComponentBindFlags), Run: app.Run(func(container container.Container) error { return container.Invoke(func(socketClient client.Client, config *WriteConfig, logger logger.Logger, configurator configurator.Configurator) { socketClient.Use(WriteTimeout(WriteConfigConfiguration(config, configurator), logger)) }) }), } WriteComponent = &app.Component{ Dependencies: app.Components{ WriteBytesLoggerComponent, WriteBytesMetricComponent, WriteTimeoutComponent, }, } Component = &app.Component{Dependencies: app.Components{ReadComponent, WriteComponent}} )
Functions ¶
func ReadBytesLogger ¶ added in v1.8.12
func ReadBytesLogger(logger logger.Logger) client.MiddlewareFunc
func ReadBytesMetric ¶ added in v1.8.12
func ReadTimeout ¶ added in v1.8.12
func ReadTimeout(config *ReadConfig, informer logger.Informer) client.MiddlewareFunc
func ReadTimeoutComponentBindFlags ¶ added in v1.8.12
func WriteBytesLogger ¶ added in v1.8.12
func WriteBytesLogger(logger logger.Logger) client.MiddlewareFunc
func WriteBytesMetric ¶ added in v1.8.12
func WriteTimeout ¶ added in v1.8.12
func WriteTimeout(config *WriteConfig, informer logger.Informer) client.MiddlewareFunc
Types ¶
type ReadConfig ¶ added in v1.8.12
func NewReadConfig ¶ added in v1.8.12
func NewReadConfig() *ReadConfig
func ReadConfigConfiguration ¶ added in v1.8.12
func ReadConfigConfiguration(config *ReadConfig, configurator configurator.Configurator) *ReadConfig
type WriteConfig ¶ added in v1.8.12
func NewWriteConfig ¶ added in v1.8.12
func NewWriteConfig() *WriteConfig
func WriteConfigConfiguration ¶ added in v1.8.12
func WriteConfigConfiguration(config *WriteConfig, configurator configurator.Configurator) *WriteConfig
Click to show internal directories.
Click to hide internal directories.