Documentation ¶
Index ¶
- Variables
- func Lookup(configType string) (func() MultiBuilder, bool)
- func Register(operatorType string, newBuilder func() Builder)
- func RegisterPlugin(pluginName string, newMultiBuilder func() MultiBuilder)
- func WrapBuilder(f func() Builder) func() MultiBuilder
- type BuildContext
- func (bc BuildContext) Copy() BuildContext
- func (bc BuildContext) PrependNamespace(id string) string
- func (bc BuildContext) WithDefaultOutputIDs(ids []string) BuildContext
- func (bc BuildContext) WithIncrementedDepth() BuildContext
- func (bc BuildContext) WithSubNamespace(namespace string) BuildContext
- type Builder
- type Config
- type Identifier
- type MultiBuilder
- type MultiBuilderWrapper
- func (m *MultiBuilderWrapper) BuildMulti(bc BuildContext) ([]Operator, error)
- func (m MultiBuilderWrapper) MarshalJSON() ([]byte, error)
- func (m MultiBuilderWrapper) MarshalYAML() (interface{}, error)
- func (m *MultiBuilderWrapper) UnmarshalJSON(bytes []byte) error
- func (m *MultiBuilderWrapper) UnmarshalYAML(unmarshal func(interface{}) error) error
- type Operator
- type Registry
Constants ¶
This section is empty.
Variables ¶
var DefaultRegistry = NewRegistry()
DefaultRegistry is a global registry of operator types to operator builders.
Functions ¶
func Lookup ¶ added in v0.12.2
func Lookup(configType string) (func() MultiBuilder, bool)
Lookup looks up a given config type, prioritizing builtin operators before looking in registered plugins. Its second return value will be false if no builder is registered for that type
func RegisterPlugin ¶ added in v0.12.2
func RegisterPlugin(pluginName string, newMultiBuilder func() MultiBuilder)
RegisterPlugin will register a plugin in the default registry
func WrapBuilder ¶ added in v0.12.2
func WrapBuilder(f func() Builder) func() MultiBuilder
WrapBuilder takes a function that would create a Builder, and returns a function that makes a MultiBuilder instead
Types ¶
type BuildContext ¶
type BuildContext struct { Database database.Database Parameters map[string]interface{} Logger *zap.SugaredLogger Namespace string DefaultOutputIDs []string PluginDepth int }
BuildContext supplies contextual resources when building an operator.
func NewBuildContext ¶ added in v0.12.2
func NewBuildContext(db database.Database, logger *zap.SugaredLogger) BuildContext
NewBuildContext creates a new build context with the given database, logger, and the default namespace
func (BuildContext) Copy ¶ added in v0.12.2
func (bc BuildContext) Copy() BuildContext
Copy creates a copy of the build context
func (BuildContext) PrependNamespace ¶ added in v0.12.2
func (bc BuildContext) PrependNamespace(id string) string
PrependNamespace adds the current namespace of the build context to the front of the given ID if that ID is not already namespaced up to the root level
func (BuildContext) WithDefaultOutputIDs ¶ added in v0.12.2
func (bc BuildContext) WithDefaultOutputIDs(ids []string) BuildContext
WithDefaultOutputIDs sets the default output IDs for the current context or the current operator build
func (BuildContext) WithIncrementedDepth ¶ added in v0.12.2
func (bc BuildContext) WithIncrementedDepth() BuildContext
WithIncrementedDepth returns a new build context with an incremented plugin depth
func (BuildContext) WithSubNamespace ¶ added in v0.12.2
func (bc BuildContext) WithSubNamespace(namespace string) BuildContext
WithSubNamespace creates a new build context with a more specific namespace
type Builder ¶
type Builder interface { Identifier Build(BuildContext) (Operator, error) }
Builder is an entity that can build a single operator
type Config ¶
type Config struct {
MultiBuilder
}
Config is the configuration of an operator
func (Config) MarshalJSON ¶
MarshalJSON will marshal a config to JSON.
func (Config) MarshalYAML ¶
MarshalYAML will marshal a config to YAML.
func (*Config) UnmarshalJSON ¶
UnmarshalJSON will unmarshal a config from JSON.
func (*Config) UnmarshalYAML ¶
UnmarshalYAML will unmarshal a config from YAML.
type Identifier ¶ added in v0.12.2
Identifier captures the methods needed to identify a builder or multibuilder
type MultiBuilder ¶ added in v0.12.2
type MultiBuilder interface { Identifier BuildMulti(BuildContext) ([]Operator, error) }
MultiBuilder is an entity that can build operators
type MultiBuilderWrapper ¶ added in v0.12.2
type MultiBuilderWrapper struct {
Builder
}
MultiBuilderWrapper wraps a Builder to turn it into a MultiBuilder
func (*MultiBuilderWrapper) BuildMulti ¶ added in v0.12.2
func (m *MultiBuilderWrapper) BuildMulti(bc BuildContext) ([]Operator, error)
BuildMulti implements MultiBuilder.BuildMulti
func (MultiBuilderWrapper) MarshalJSON ¶ added in v0.12.2
func (m MultiBuilderWrapper) MarshalJSON() ([]byte, error)
MarshalJSON marshalls JSON
func (MultiBuilderWrapper) MarshalYAML ¶ added in v0.12.2
func (m MultiBuilderWrapper) MarshalYAML() (interface{}, error)
MarshalYAML marshalls YAML
func (*MultiBuilderWrapper) UnmarshalJSON ¶ added in v0.12.2
func (m *MultiBuilderWrapper) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshals JSON
func (*MultiBuilderWrapper) UnmarshalYAML ¶ added in v0.12.2
func (m *MultiBuilderWrapper) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML unmarshals 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() 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 // SetOutputs will set the connected outputs. SetOutputs([]Operator) error // 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 Registry ¶ added in v0.12.2
type Registry struct {
// contains filtered or unexported fields
}
Registry is a registry for operators and plugins that is used for building types from IDs
func (*Registry) Lookup ¶ added in v0.12.2
func (r *Registry) Lookup(configType string) (func() MultiBuilder, bool)
Lookup looks up a given config type, prioritizing builtin operators before looking in registered plugins. Its second return value will be false if no builder is registered for that type
func (*Registry) Register ¶ added in v0.12.2
Register will register a function to an operator type. This function will return a builder for the supplied type.
func (*Registry) RegisterPlugin ¶ added in v0.12.2
func (r *Registry) RegisterPlugin(pluginName string, newBuilder func() MultiBuilder)
RegisterPlugin will register a function to an plugin type. This function will return a builder for the supplied type.
Directories ¶
Path | Synopsis |
---|---|
builtin
|
|
input/k8sevent
Module
|
|
input/windows
Module
|
|
output/elastic
Module
|
|
output/googlecloud
Module
|
|
output/newrelic
Module
|
|
output/otlp
Module
|
|
parser/syslog
Module
|
|
transformer/k8smetadata
Module
|
|