Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultRegistry = NewRegistry()
DefaultRegistry is a global registry of operator types to operator builders.
Functions ¶
Types ¶
type Builder ¶
type Builder interface { ID() string Type() string Build(*zap.SugaredLogger) (Operator, error) SetID(string) }
Builder is an entity that can build a single operator
type Config ¶
type Config struct {
Builder
}
Config is the configuration of an operator
func (*Config) UnmarshalJSON ¶
UnmarshalJSON will unmarshal a config from JSON.
func (*Config) UnmarshalYAML ¶
UnmarshalYAML will unmarshal a config from YAML.
type Operator ¶
type Operator interface { // ID returns the id of the operator. ID() string // Type returns the type of the operator. Type() string // Start will start the operator. Start(Persister) error // Stop will stop the operator. Stop() error // CanOutput indicates if the operator will output entries to other operators. CanOutput() bool // Outputs returns the list of connected outputs. Outputs() []Operator // GetOutputIDs returns the list of connected outputs. GetOutputIDs() []string // SetOutputs will set the connected outputs. SetOutputs([]Operator) error // SetOutputIDs will set the connected outputs' IDs. SetOutputIDs([]string) // CanProcess indicates if the operator will process entries from other operators. CanProcess() bool // Process will process an entry from an operator. Process(context.Context, *entry.Entry) error // Logger returns the operator's logger Logger() *zap.SugaredLogger }
Operator is a log monitoring component.
type Persister ¶
type Persister interface { Get(context.Context, string) ([]byte, error) Set(context.Context, string, []byte) error Delete(context.Context, string) error }
Persister is an interface used to persist data
func NewScopedPersister ¶
Click to show internal directories.
Click to hide internal directories.