Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer interface { Flush(context.Context) error Add(interface{}, int) error AddWait(context.Context, interface{}, int) error SetHandler(BundleHandler) Process(context.Context, *entry.Entry) error }
Buffer is an entity that buffers log entries to an operator
type BundleHandler ¶
type BundleHandler interface { ProcessMulti(context.Context, []*entry.Entry) error Logger() *zap.SugaredLogger }
BundleHandler is an interface that process multiple entries
type Config ¶
type Config struct { BufferType string `json:"type,omitempty" yaml:"type,omitempty"` DelayThreshold operator.Duration `json:"delay_threshold,omitempty" yaml:"delay_threshold,omitempty"` BundleCountThreshold int `json:"bundle_count_threshold,omitempty" yaml:"buffer_count_threshold,omitempty"` BundleByteThreshold int `json:"bundle_byte_threshold,omitempty" yaml:"bundle_byte_threshold,omitempty"` BundleByteLimit int `json:"bundle_byte_limit,omitempty" yaml:"bundle_byte_limit,omitempty"` BufferedByteLimit int `json:"buffered_byte_limit,omitempty" yaml:"buffered_byte_limit,omitempty"` HandlerLimit int `json:"handler_limit,omitempty" yaml:"handler_limit,omitempty"` Retry RetryConfig `json:"retry,omitempty" yaml:"retry,omitempty"` }
Config is the configuration of a buffer
type MemoryBuffer ¶
MemoryBuffer is a buffer that holds entries in memory
func NewMemoryBuffer ¶
func NewMemoryBuffer(config *Config) *MemoryBuffer
NewMemoryBuffer will return a new memory buffer with the supplied configuration
func (*MemoryBuffer) Flush ¶
func (m *MemoryBuffer) Flush(ctx context.Context) error
Flush will flush the memory buffer
func (*MemoryBuffer) NewExponentialBackOff ¶
func (m *MemoryBuffer) NewExponentialBackOff() *backoff.ExponentialBackOff
NewExponentialBackOff will return a new exponential backoff for the memory buffer to use
func (*MemoryBuffer) SetHandler ¶
func (m *MemoryBuffer) SetHandler(handler BundleHandler)
SetHandler will set the handler of the memory buffer
type RetryConfig ¶
type RetryConfig struct { InitialInterval operator.Duration `json:"initial_interval,omitempty" yaml:"initial_interval,omitempty"` RandomizationFactor float64 `json:"randomization_factor,omitempty" yaml:"randomization_factor,omitempty"` Multiplier float64 `json:"multiplier,omitempty" yaml:"multiplier,omitempty"` MaxInterval operator.Duration `json:"max_interval,omitempty" yaml:"max_interval,omitempty"` MaxElapsedTime operator.Duration `json:"max_elapsed_time,omitempty" yaml:"max_elapsed_time,omitempty"` }
RetryConfig is the configuration of an entity that will retry processing after an error
func NewRetryConfig ¶
func NewRetryConfig() RetryConfig
Click to show internal directories.
Click to hide internal directories.