flusher

package
v0.13.13-0...-98661b4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// MaxConcurrent is the maximum number of goroutines flushing entries concurrently.
	// Defaults to 16.
	MaxConcurrent int `json:"max_concurrent" yaml:"max_concurrent"`
}

Config holds the configuration to build a new flusher

func NewConfig

func NewConfig() Config

NewConfig creates a new default flusher config

func (*Config) Build

func (c *Config) Build(logger *zap.SugaredLogger) *Flusher

Build uses a Config to build a new Flusher

type FlushFunc

type FlushFunc func(context.Context) error

FlushFunc is any function that flushes

type Flusher

type Flusher struct {
	*zap.SugaredLogger
	// contains filtered or unexported fields
}

Flusher is used to flush entries from a buffer concurrently. It handles max concurrency, retry behavior, and cancellation.

func (*Flusher) Do

func (f *Flusher) Do(flush FlushFunc)

Do executes the flusher function in a goroutine

func (*Flusher) Stop

func (f *Flusher) Stop()

Stop cancels all the in-progress flushers and waits until they have returned

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL