sourcemgr

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package sourcemgr implements a component managing logs-agent sources (type LogSource). It receives additions and removals of sources from other components, and it informs subscribers of these additions and removals.

Once added to this component, a LogSource must be considered immutable: neither the component having called AddSource, nor any of the subscribers, may modify the source.

All component methods can be called concurrently.

Index

Constants

This section is empty.

Variables

View Source
var Module fx.Option = fx.Module(
	"comp/logs/internal/sourcemgr",
	fx.Provide(newSourceMgr),
)

Module defines the fx options for this component.

Functions

This section is empty.

Types

type Component

type Component interface {
	// Subscribe registers a subscriber for add/remove events.  This must be called
	// before the component starts.  Subscribers cannot be unsubscribed.
	Subscribe() (subscriptions.Subscriber[SourceChange], error)

	// AddSource adds a new log source.
	AddSource(*LogSource)

	// RemoveSource removes an existing log source.
	RemoveSource(*LogSource)
}

Component is the component type.

type LogSource

type LogSource struct {
	Name string
}

LogSource defines a source for logs.

type SourceChange

type SourceChange struct {
	// IsAdd is true when the source is being added, and false when it is being removed.
	IsAdd bool

	// Source is the source being added or removed.
	Source *LogSource
}

Launcher defines the interface each launcher must satisfy.

Jump to

Keyboard shortcuts

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