tailers

package
v0.0.0-...-561fc3e Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

README

Tailers

Tailers are responsible for gathering log messages and sending them for further handling by the remainder of the logs agent. It is the responsibility of a launcher to create and manage tailers.

A tailer sends log messages via a chan *message.Message.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnyTailerContainer

type AnyTailerContainer interface {
	Tailers() []Tailer
}

AnyTailerContainer is a type erased tailer container. This is used as a proxy for typed tailer containers to mix and match collections of tailers of any underlying type.

type Tailer

type Tailer interface {
	GetId() string
	GetType() string
	GetInfo() *status.InfoRegistry
}

Tailer is the base interface for a tailer.

type TailerContainer

type TailerContainer[T Tailer] struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

TailerContainer is a container for a concrete tailer type.

func NewTailerContainer

func NewTailerContainer[T Tailer]() *TailerContainer[T]

NewTailerContainer creates a new TailerContainer instance.

func (*TailerContainer[T]) Add

func (t *TailerContainer[T]) Add(tailer T)

Add adds a new tailer to the container.

func (*TailerContainer[T]) All

func (t *TailerContainer[T]) All() []T

All returns a slice of all tailers in the container.

func (*TailerContainer[T]) Contains

func (t *TailerContainer[T]) Contains(id string) bool

Contains returns true if the key exists.

func (*TailerContainer[T]) Count

func (t *TailerContainer[T]) Count() int

Count returns the number of tailers in the container.

func (*TailerContainer[T]) Get

func (t *TailerContainer[T]) Get(id string) (T, bool)

Get returns a tailer with the provided id if it exists.

func (*TailerContainer[T]) Remove

func (t *TailerContainer[T]) Remove(tailer T)

Remove removes a tailer from the container.

func (*TailerContainer[T]) Tailers

func (t *TailerContainer[T]) Tailers() []Tailer

Tailers returns a slice of all tailers in the container without their concrete types.

type TailerTracker

type TailerTracker struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

TailerTracker keeps track of all the active tailers in the agent.

func NewTailerTracker

func NewTailerTracker() *TailerTracker

NewTailerTracker creates a new TailerTracker instance.

func (*TailerTracker) Add

func (t *TailerTracker) Add(container AnyTailerContainer)

Add a tailer container to the tracker.

func (*TailerTracker) All

func (t *TailerTracker) All() []Tailer

All returns all active tailers.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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