batching

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2018 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batcher

type Batcher struct {
	// contains filtered or unexported fields
}

Batcher builds lists of records for dispatch

func NewBatcher

func NewBatcher(capacity int, duration time.Duration, dispatchFunc DispatchFunc) *Batcher

NewBatcher configure a new batcher and it's dipsatch function

func (*Batcher) Handler

func (b *Batcher) Handler(channel syslog.LogPartsChannel)

Handler handle incoming log messages and write batches to the dispatcher function

func (*Batcher) Length

func (b *Batcher) Length() int

Length returns the current length of the buffer.

type DispatchFunc

type DispatchFunc func([]*LogEntry)

DispatchFunc invoked when a batch is ready to send

type LogEntry

type LogEntry struct {
	Message        string
	Parts          map[string]interface{}
	MilliTimestamp int64
}

LogEntry decoded log entry

Jump to

Keyboard shortcuts

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