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
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
Click to show internal directories.
Click to hide internal directories.