dispatcher

package
v0.1.6-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainersProvider

type ContainersProvider interface {
	Containers() (containers.Containers, error)
}

ContainersProvider is a containers provider interface for dispatcher

type Dispatcher

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

Dispatcher starts and stops followers according to ContainersProvider targets, multiplexes their outputs into output; based on config, starts system journal special follower and pipes its output separately

func NewDispatcher

func NewDispatcher(
	config configuration.Config, followerFabric workers.FollowerFabric, containersProvider ContainersProvider,
	cursorStorage workers.Storage, logger logging.Logger) *Dispatcher

NewDispatcher is a Dispatcher constructor

func (*Dispatcher) Out

func (d *Dispatcher) Out() <-chan *common.Entry

Out is a dispatcher output channel accessor

func (*Dispatcher) OutJournald

func (d *Dispatcher) OutJournald() <-chan string

OutJournald is a dispatcher outputJournald channel accessor

func (*Dispatcher) Start

func (d *Dispatcher) Start(ctx context.Context)

Start starts Dispatcher. Dispatcher quits when context is done.

type FollowerPool

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

FollowerPool is a map of Follower instances to control over

func NewFollowerPool

func NewFollowerPool() FollowerPool

FollowerPool constructor

func (*FollowerPool) Add

func (fp *FollowerPool) Add(path string, follower workers.Follower)

Add adds follower to pool by path

func (*FollowerPool) Get

func (fp *FollowerPool) Get(path string) (follower workers.Follower, ok bool)

Get returns follower and present flag by path

func (*FollowerPool) Pool

func (fp *FollowerPool) Pool() (pool map[string]workers.Follower)

Pool returns copy of current pool

func (*FollowerPool) Remove

func (fp *FollowerPool) Remove(path string)

Remove removes follower from pool by path

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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