Documentation ¶
Overview ¶
Package buffered provides an implementation for the audit.Backend interface that batches incoming audit events and sends batches to the delegate audit.Backend.
Index ¶
Constants ¶
View Source
const PluginName = "buffered"
PluginName is the name reported in error metrics.
Variables ¶
This section is empty.
Functions ¶
func NewBackend ¶
func NewBackend(delegate audit.Backend, config BatchConfig) audit.Backend
NewBackend returns a buffered audit backend that wraps delegate backend.
Types ¶
type BatchConfig ¶
type BatchConfig struct { // BufferSize defines a size of the buffering queue. BufferSize int // MaxBatchSize defines maximum size of a batch. MaxBatchSize int // MaxBatchWait indicates the maximum interval between two batches. MaxBatchWait time.Duration // ThrottleEnable defines whether throttling will be applied to the batching process. ThrottleEnable bool // ThrottleQPS defines the allowed rate of batches per second sent to the delegate backend. ThrottleQPS float32 // ThrottleBurst defines the maximum rate of batches per second sent to the delegate backend in case // the capacity defined by ThrottleQPS was not utilized. ThrottleBurst int }
BatchConfig represents batching delegate audit backend configuration.
func NewDefaultBatchConfig ¶
func NewDefaultBatchConfig() BatchConfig
NewDefaultBatchConfig returns new Config objects populated by default values.
Click to show internal directories.
Click to hide internal directories.