api

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmpty  = errors.New("cannot read data when the queue is empty")
	ErrFull   = errors.New("cannot write data when the queue is full")
	ErrClosed = errors.New("cannot enqueue or dequeue when the queue is closed")
)

Functions

This section is empty.

Types

type Queue

type Queue interface {
	plugin.Plugin

	// Initialize creates the queue.
	Initialize() error

	// Enqueue a inputEvent into the queue.
	Enqueue(event *v1.SniffData) error

	// Dequeue returns a SequenceEvent when Queue is not empty,
	Dequeue() (*SequenceEvent, error)

	// Close would close the queue.
	Close() error

	// Ack the lastOffset
	Ack(lastOffset *event.Offset)

	// TotalSize total capacity of queue
	TotalSize() int64

	// UsedCount used count of queue
	UsedCount() int64

	// IsFull the queue is full
	IsFull() bool
}

Queue is a plugin interface, that defines new queues.

func GetQueue

func GetQueue(config plugin.Config) Queue

GetQueue an initialized filter plugin.

type SequenceEvent

type SequenceEvent struct {
	Event  *v1.SniffData
	Offset event.Offset
}

SequenceEvent is a wrapper to pass the event and the offset.

Jump to

Keyboard shortcuts

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