bundle

package
v3.48.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package bundle contains singletons referenced throughout the Benthos codebase that allow imported components to add their constructors and documentation to a service.

Each component type has it's own singleton bundle containing all imported implementations of the component, and from this bundle more can be derived that modify the components that are available.

Index

Constants

This section is empty.

Variables

View Source
var AllBuffers = &BufferSet{
	specs: map[string]bufferSpec{},
}

AllBuffers is a set containing every single buffer that has been imported.

View Source
var AllCaches = &CacheSet{
	specs: map[string]cacheSpec{},
}

AllCaches is a set containing every single cache that has been imported.

View Source
var AllInputs = &InputSet{
	specs: map[string]inputSpec{},
}

AllInputs is a set containing every single input that has been imported.

View Source
var AllMetrics = &MetricsSet{
	specs: map[string]metricsSpec{},
}

AllMetrics is a set containing every single metrics that has been imported.

View Source
var AllOutputs = &OutputSet{
	specs: map[string]outputSpec{},
}

AllOutputs is a set containing every single output that has been imported.

View Source
var AllProcessors = &ProcessorSet{
	specs: map[string]processorSpec{},
}

AllProcessors is a set containing every single processor that has been imported.

View Source
var AllRateLimits = &RateLimitSet{
	specs: map[string]rateLimitSpec{},
}

AllRateLimits is a set containing every single ratelimit that has been imported.

View Source
var AllTracers = &TracerSet{
	specs: map[string]tracerSpec{},
}

AllTracers is a set containing every single tracer that has been imported.

Functions

This section is empty.

Types

type BufferConstructor

type BufferConstructor func(buffer.Config, NewManagement) (buffer.Type, error)

BufferConstructor constructs an buffer component.

type BufferSet

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

BufferSet contains an explicit set of buffers available to a Benthos service.

func (*BufferSet) Add

func (s *BufferSet) Add(constructor BufferConstructor, spec docs.ComponentSpec) error

Add a new buffer to this set by providing a spec (name, documentation, and constructor).

func (*BufferSet) Docs

func (s *BufferSet) Docs() []docs.ComponentSpec

Docs returns a slice of buffer specs, which document each method.

func (*BufferSet) DocsFor

func (s *BufferSet) DocsFor(name string) (docs.ComponentSpec, bool)

DocsFor returns the documentation for a given component name, returns a boolean indicating whether the component name exists.

func (*BufferSet) Init

func (s *BufferSet) Init(conf buffer.Config, mgr NewManagement) (buffer.Type, error)

Init attempts to initialise an buffer from a config.

type CacheConstructor

type CacheConstructor func(cache.Config, NewManagement) (types.Cache, error)

CacheConstructor constructs an cache component.

type CacheSet

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

CacheSet contains an explicit set of caches available to a Benthos service.

func (*CacheSet) Add

func (s *CacheSet) Add(constructor CacheConstructor, spec docs.ComponentSpec) error

Add a new cache to this set by providing a spec (name, documentation, and constructor).

func (*CacheSet) Docs

func (s *CacheSet) Docs() []docs.ComponentSpec

Docs returns a slice of cache specs, which document each method.

func (*CacheSet) DocsFor

func (s *CacheSet) DocsFor(name string) (docs.ComponentSpec, bool)

DocsFor returns the documentation for a given component name, returns a boolean indicating whether the component name exists.

func (*CacheSet) Init

func (s *CacheSet) Init(conf cache.Config, mgr NewManagement) (types.Cache, error)

Init attempts to initialise an cache from a config.

type InputConstructor

type InputConstructor func(bool, input.Config, NewManagement, ...types.PipelineConstructorFunc) (input.Type, error)

InputConstructor constructs an input component.

func InputConstructorFromSimple

func InputConstructorFromSimple(fn func(input.Config, NewManagement) (input.Type, error)) InputConstructor

InputConstructorFromSimple provides a way to define an input constructor without manually initializing processors of the config.

type InputSet

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

InputSet contains an explicit set of inputs available to a Benthos service.

func (*InputSet) Add

func (s *InputSet) Add(constructor InputConstructor, spec docs.ComponentSpec) error

Add a new input to this set by providing a constructor and documentation.

func (*InputSet) Docs

func (s *InputSet) Docs() []docs.ComponentSpec

Docs returns a slice of input specs, which document each method.

func (*InputSet) DocsFor

func (s *InputSet) DocsFor(name string) (docs.ComponentSpec, bool)

DocsFor returns the documentation for a given component name, returns a boolean indicating whether the component name exists.

func (*InputSet) Init

func (s *InputSet) Init(
	hasBatchProc bool,
	conf input.Config,
	mgr NewManagement,
	pipelines ...types.PipelineConstructorFunc,
) (types.Input, error)

Init attempts to initialise an input from a config.

type MetricConstructor

type MetricConstructor metrics.ConstructorFunc

MetricConstructor constructs an metrics component.

type MetricsSet

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

MetricsSet contains an explicit set of metrics available to a Benthos service.

func (*MetricsSet) Add

func (s *MetricsSet) Add(constructor MetricConstructor, spec docs.ComponentSpec) error

Add a new metrics to this set by providing a spec (name, documentation, and constructor).

func (*MetricsSet) Docs

func (s *MetricsSet) Docs() []docs.ComponentSpec

Docs returns a slice of metrics specs, which document each method.

func (*MetricsSet) DocsFor

func (s *MetricsSet) DocsFor(name string) (docs.ComponentSpec, bool)

DocsFor returns the documentation for a given component name, returns a boolean indicating whether the component name exists.

func (*MetricsSet) Init

func (s *MetricsSet) Init(conf metrics.Config, opts ...func(metrics.Type)) (metrics.Type, error)

Init attempts to initialise an metrics from a config.

type NewManagement

type NewManagement interface {
	types.Manager

	ForStream(id string) types.Manager
	ForComponent(id string) types.Manager
	ForChildComponent(id string) types.Manager
	Label() string

	Metrics() metrics.Type
	Logger() log.Modular

	NewBuffer(conf buffer.Config) (buffer.Type, error)
	NewCache(conf cache.Config) (types.Cache, error)
	NewInput(conf input.Config, hasBatchProc bool, pipelines ...types.PipelineConstructorFunc) (types.Input, error)
	NewProcessor(conf processor.Config) (types.Processor, error)
	NewOutput(conf output.Config, pipelines ...types.PipelineConstructorFunc) (types.Output, error)
	NewRateLimit(conf ratelimit.Config) (types.RateLimit, error)

	AccessCache(ctx context.Context, name string, fn func(types.Cache)) error
	StoreCache(ctx context.Context, name string, conf cache.Config) error

	AccessInput(ctx context.Context, name string, fn func(types.Input)) error
	StoreInput(ctx context.Context, name string, conf input.Config) error

	AccessProcessor(ctx context.Context, name string, fn func(types.Processor)) error
	StoreProcessor(ctx context.Context, name string, conf processor.Config) error

	AccessOutput(ctx context.Context, name string, fn func(types.OutputWriter)) error
	StoreOutput(ctx context.Context, name string, conf output.Config) error

	AccessRateLimit(ctx context.Context, name string, fn func(types.RateLimit)) error
	StoreRateLimit(ctx context.Context, name string, conf ratelimit.Config) error
}

NewManagement defines the latest API for a Benthos manager, which will become the only API (internally) in Benthos V4.

type OutputConstructor

type OutputConstructor func(output.Config, NewManagement, ...types.PipelineConstructorFunc) (output.Type, error)

OutputConstructor constructs an output component.

func OutputConstructorFromSimple

func OutputConstructorFromSimple(fn func(output.Config, NewManagement) (output.Type, error)) OutputConstructor

OutputConstructorFromSimple provides a way to define an output constructor without manually initializing processors of the config.

type OutputSet

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

OutputSet contains an explicit set of outputs available to a Benthos service.

func (*OutputSet) Add

func (s *OutputSet) Add(constructor OutputConstructor, spec docs.ComponentSpec) error

Add a new output to this set by providing a spec (name, documentation, and constructor).

func (*OutputSet) Docs

func (s *OutputSet) Docs() []docs.ComponentSpec

Docs returns a slice of output specs, which document each method.

func (*OutputSet) DocsFor

func (s *OutputSet) DocsFor(name string) (docs.ComponentSpec, bool)

DocsFor returns the documentation for a given component name, returns a boolean indicating whether the component name exists.

func (*OutputSet) Init

func (s *OutputSet) Init(
	conf output.Config,
	mgr NewManagement,
	pipelines ...types.PipelineConstructorFunc,
) (types.Output, error)

Init attempts to initialise an output from a config.

type ProcessorConstructor

type ProcessorConstructor func(processor.Config, NewManagement) (processor.Type, error)

ProcessorConstructor constructs an processor component.

type ProcessorSet

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

ProcessorSet contains an explicit set of processors available to a Benthos service.

func (*ProcessorSet) Add

func (s *ProcessorSet) Add(constructor ProcessorConstructor, spec docs.ComponentSpec) error

Add a new processor to this set by providing a spec (name, documentation, and constructor).

func (*ProcessorSet) Docs

func (s *ProcessorSet) Docs() []docs.ComponentSpec

Docs returns a slice of processor specs, which document each method.

func (*ProcessorSet) DocsFor

func (s *ProcessorSet) DocsFor(name string) (docs.ComponentSpec, bool)

DocsFor returns the documentation for a given component name, returns a boolean indicating whether the component name exists.

func (*ProcessorSet) Init

Init attempts to initialise an processor from a config.

type RateLimitConstructor

type RateLimitConstructor func(ratelimit.Config, NewManagement) (types.RateLimit, error)

RateLimitConstructor constructs an ratelimit component.

type RateLimitSet

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

RateLimitSet contains an explicit set of ratelimits available to a Benthos service.

func (*RateLimitSet) Add

func (s *RateLimitSet) Add(constructor RateLimitConstructor, spec docs.ComponentSpec) error

Add a new ratelimit to this set by providing a spec (name, documentation, and constructor).

func (*RateLimitSet) Docs

func (s *RateLimitSet) Docs() []docs.ComponentSpec

Docs returns a slice of ratelimit specs, which document each method.

func (*RateLimitSet) DocsFor

func (s *RateLimitSet) DocsFor(name string) (docs.ComponentSpec, bool)

DocsFor returns the documentation for a given component name, returns a boolean indicating whether the component name exists.

func (*RateLimitSet) Init

Init attempts to initialise an ratelimit from a config.

type TracerConstructor

type TracerConstructor tracer.ConstructorFunc

TracerConstructor constructs an tracer component.

type TracerSet

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

TracerSet contains an explicit set of tracers available to a Benthos service.

func (*TracerSet) Add

func (s *TracerSet) Add(constructor TracerConstructor, spec docs.ComponentSpec) error

Add a new tracer to this set by providing a spec (name, documentation, and constructor).

func (*TracerSet) Docs

func (s *TracerSet) Docs() []docs.ComponentSpec

Docs returns a slice of tracer specs, which document each method.

func (*TracerSet) DocsFor

func (s *TracerSet) DocsFor(name string) (docs.ComponentSpec, bool)

DocsFor returns the documentation for a given component name, returns a boolean indicating whether the component name exists.

func (*TracerSet) Init

func (s *TracerSet) Init(conf tracer.Config, opts ...func(tracer.Type)) (tracer.Type, error)

Init attempts to initialise an tracer from a config.

Jump to

Keyboard shortcuts

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