auditor

package module
v0.54.0-devel Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 11 Imported by: 10

Documentation

Index

Constants

View Source
const DefaultRegistryFilename = "registry.json"

DefaultRegistryFilename is the default registry filename

Variables

This section is empty.

Functions

This section is empty.

Types

type Auditor

type Auditor interface {
	Registry
	Start()
	Stop()
	// Channel returns the channel to which successful payloads should be sent.
	Channel() chan *message.Payload
}

An Auditor handles messages successfully submitted to the intake

type JSONRegistry

type JSONRegistry struct {
	Version  int
	Registry map[string]RegistryEntry
}

JSONRegistry represents the registry that will be written on disk

type NullAuditor

type NullAuditor struct {
	// contains filtered or unexported fields
}

NullAuditor is an auditor not doing anything with the message it received. It has been introduced for the Serverless Agent which doesn't need to maintain a registry.

func NewNullAuditor

func NewNullAuditor() *NullAuditor

NewNullAuditor returns an instanciated NullAuditor. `Start()` is the next method that should be used on this NullAuditor.

func (*NullAuditor) Channel

func (a *NullAuditor) Channel() chan *message.Payload

Channel returns the channel on which should be sent the messages.

func (*NullAuditor) GetOffset

func (a *NullAuditor) GetOffset(identifier string) string

GetOffset returns an empty string.

func (*NullAuditor) GetTailingMode

func (a *NullAuditor) GetTailingMode(identifier string) string

GetTailingMode returns an empty string.

func (*NullAuditor) Start

func (a *NullAuditor) Start()

Start starts the NullAuditor main loop.

func (*NullAuditor) Stop

func (a *NullAuditor) Stop()

Stop stops the NullAuditor main loop.

type Registry

type Registry interface {
	GetOffset(identifier string) string
	GetTailingMode(identifier string) string
}

Registry holds a list of offsets.

type RegistryAuditor

type RegistryAuditor struct {
	// contains filtered or unexported fields
}

A RegistryAuditor is storing the Auditor information using a registry.

func New

func New(runPath string, filename string, ttl time.Duration, health *health.Handle) *RegistryAuditor

New returns an initialized Auditor

func (*RegistryAuditor) Channel

func (a *RegistryAuditor) Channel() chan *message.Payload

Channel returns the channel to use to communicate with the auditor or nil if the auditor is currently stopped.

func (*RegistryAuditor) GetOffset

func (a *RegistryAuditor) GetOffset(identifier string) string

GetOffset returns the last committed offset for a given identifier, returns an empty string if it does not exist.

func (*RegistryAuditor) GetTailingMode

func (a *RegistryAuditor) GetTailingMode(identifier string) string

GetTailingMode returns the last committed offset for a given identifier, returns an empty string if it does not exist.

func (*RegistryAuditor) Start

func (a *RegistryAuditor) Start()

Start starts the Auditor

func (*RegistryAuditor) Stop

func (a *RegistryAuditor) Stop()

Stop stops the Auditor

type RegistryEntry

type RegistryEntry struct {
	LastUpdated        time.Time
	Offset             string
	TailingMode        string
	IngestionTimestamp int64
}

A RegistryEntry represents an entry in the registry where we keep track of current offsets

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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