batcher

package
v0.0.0-...-3807025 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2025 License: Apache-2.0, MIT Imports: 5 Imported by: 0

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 A simple generic implementation of Falco payloads batching Batching can be configured by the batchSize which is a max number of payloads in the batch or the flushInterval. The callback function is called when the number of payloads reaches the batchSize or upon the flushInterval

func New

func New(opts ...OptionFunc) *Batcher

func (*Batcher) Push

func (b *Batcher) Push(falcopayload types.FalcoPayload) error

type CallbackFunc

type CallbackFunc func(falcoPayloads []types.FalcoPayload, serialized []byte)

type MarshalFunc

type MarshalFunc func(payload types.FalcoPayload) ([]byte, error)

MarshalFunc is a callback that allows the user of the batcher to overwrite the default JSON marshalling

type OptionFunc

type OptionFunc func(b *Batcher)

func WithBatchSize

func WithBatchSize(sz int) OptionFunc

func WithCallback

func WithCallback(cb CallbackFunc) OptionFunc

func WithFlushInterval

func WithFlushInterval(interval time.Duration) OptionFunc

func WithMarshal

func WithMarshal(fn MarshalFunc) OptionFunc

Jump to

Keyboard shortcuts

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