workers

package
v0.1.4-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoRecords = errors.New("no data read")

Functions

This section is empty.

Types

type Follower

type Follower interface {
	Start(ctx context.Context)
	Stop()
	GetActiveFlag() bool
	SetEOFShutdownFlag()
}

Follower is a worker-follower interface for dispatcher

type FollowerFabric

type FollowerFabric interface {
	NewFollower(
		output chan<- *common.Entry, filePath, format string, extends common.EntryMap) (Follower, error)
	NewFollowerJournald(
		output chan<- string, config configuration.ParserConfig, logger logging.Logger) (FollowerJournald, error)
}

FollowerFabric is a follower fabric interface for dispatcher

type FollowerJournald

type FollowerJournald interface {
	Start(ctx context.Context)
}

FollowerJournald is a worker-follower interface for dispatcher

type FollowersFabric

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

func NewFollowersFabric

func NewFollowersFabric(config configuration.Config,
	collector MetricsCollector, storage Storage, rater Rater, logger logging.Logger) *FollowersFabric

func (*FollowersFabric) NewFollower

func (f *FollowersFabric) NewFollower(output chan<- *common.Entry, filePath, format string,
	containerExtends common.EntryMap) (Follower, error)

func (*FollowersFabric) NewFollowerJournald

func (f *FollowersFabric) NewFollowerJournald(output chan<- string, config configuration.ParserConfig,
	logger logging.Logger) (FollowerJournald, error)

NewFollowerJournald constructor

type JournaldReader

type JournaldReader interface {
	EntryRead() (entryMap common.EntryMap, err error)
	GetAcquireFlag() bool
	GetCursor() string
	Close() error
}

JournaldReader is specific journal reader interface

type LineReader

type LineReader interface {
	EntryRead() (entry []byte, prefixFlag bool, err error)
	GetCursor() *readers.Cursor
	GetAcquireFlag() bool
	Close() error
}

LineReader is reader interface for log follower

type MetricsCollector

type MetricsCollector interface {
	IncrementLogMessageCount(namespace, podName, containerName string)
	IncrementThrottlingDelay(namespace, podName, containerName string, value float64)
	DeleteThrottlingDelay(namespace, podName, containerName string) bool
}

MetricsCollector is a metrics counter object interface for workers

type Rater

type Rater interface {
	Rate(namespace string, pod string) float64
}

Rater is a throttling rater interface for workers

type Storage

type Storage interface {
	Get(key string) (string, error)
	Set(key string, value string) error
	Delete(string) error
	Keys() ([]string, error)
}

Storage is the cursor storage interface for dispatcher

Jump to

Keyboard shortcuts

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