Documentation ¶
Index ¶
Constants ¶
View Source
const ( StatusDelivering = iota // if we are in running mode - delivering messages StatusPaused // if we have paused the inputs )
Variables ¶
View Source
var (
ErrContextCancelled = errutil.NewFactory("context canceled")
)
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue interface { config.TypeCommonConfig // has to be here to be a supported TypeOutputConfig. Output(ctx context.Context, event logevent.LogEvent) error // has to be here to be a supported TypeOutputConfig. Queue(ctx context.Context, event any) error // allows the output to queue an event, also pausing the input if needed. Thread safe. Resume(ctx context.Context) error // informs that the output is working again - can be called multiple times and is thread safe. }
Queue allows for queueing of data into the queue
func NewSimpleQueue ¶
func NewSimpleQueue(ctx context.Context, control config.Control, receiver QueueReceiver, outch chan []byte, queueSize int, retryInterval uint) Queue
NewSimpleQueue returns a new queue using a simple retry/queuing mechanism. receiver is your Output object. queueSize is the number of events that will be queued before dropping events from the queue; with a value of -1 the sky is the limit. retryInterval is the time in seconds between each retry.
type QueueReceiver ¶
type QueueReceiver interface { config.TypeCommonConfig // OutputEvent is the event that is called from the queue when an event is to be processed. This // event typically replaces your existing Output() and is called when an event is ready to be sent out on the output. OutputEvent(ctx context.Context, event logevent.LogEvent) (err error) }
QueueReceiver defines an interface for using a queue when incoming events has to pause. This should be the output object, implementing OutputEvent and TypeCommonConfig.
Click to show internal directories.
Click to hide internal directories.