interop

package
v3.59.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package interop provides utilities for initializing Benthos components that default to the old APIs, but when the provided manager supports it the new APIs are used.

TODO: V4 Remove this package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessCache added in v3.47.0

func AccessCache(ctx context.Context, mgr types.Manager, name string, fn func(types.Cache)) error

AccessCache attempts to access a cache resource by a unique identifier and executes a closure function with the cache as an argument. Returns an error if the cache does not exist (or is otherwise inaccessible).

func AccessInput added in v3.47.0

func AccessInput(ctx context.Context, mgr types.Manager, name string, fn func(types.Input)) error

AccessInput attempts to access an input resource by a unique identifier and executes a closure function with the input as an argument. Returns an error if the input does not exist (or is otherwise inaccessible).

func AccessOutput added in v3.47.0

func AccessOutput(ctx context.Context, mgr types.Manager, name string, fn func(types.OutputWriter)) error

AccessOutput attempts to access an output resource by a unique identifier and executes a closure function with the output as an argument. Returns an error if the output does not exist (or is otherwise inaccessible).

func AccessProcessor added in v3.47.0

func AccessProcessor(ctx context.Context, mgr types.Manager, name string, fn func(types.Processor)) error

AccessProcessor attempts to access a processor resource by a unique identifier and executes a closure function with the processor as an argument. Returns an error if the processor does not exist (or is otherwise inaccessible).

func AccessRateLimit added in v3.47.0

func AccessRateLimit(ctx context.Context, mgr types.Manager, name string, fn func(types.RateLimit)) error

AccessRateLimit attempts to access a rate limit resource by a unique identifier and executes a closure function with the rate limit as an argument. Returns an error if the rate limit does not exist (or is otherwise inaccessible).

func GetLabel

func GetLabel(mgr types.Manager) string

GetLabel attempts the extract the current label of a component by obtaining it from a manager. If the manager does not support label methods then it instead falls back to a UUID, and somehow failing that returns an empty string.

func LabelChild

func LabelChild(label string, mgr types.Manager, logger log.Modular, stats metrics.Type) (types.Manager, log.Modular, metrics.Type)

LabelChild expands the label of the provided observability components.

func LabelRoot

func LabelRoot(label string, mgr types.Manager, logger log.Modular, stats metrics.Type) (types.Manager, log.Modular, metrics.Type)

LabelRoot replaces the label of the provided observability components.

func LabelStream

func LabelStream(label string, mgr types.Manager, logger log.Modular, stats metrics.Type) (types.Manager, log.Modular, metrics.Type)

LabelStream expands the label of the provided observability components with a stream identifier.

func NewBloblangField added in v3.56.0

func NewBloblangField(mgr types.Manager, expr string) (*field.Expression, error)

NewBloblangField parses a bloblang interpolated field using either the global environment, or, when the provided manager supports the newer BloblEnvironment method, the manager environment.

func NewBloblangMapping added in v3.56.0

func NewBloblangMapping(mgr types.Manager, blobl string) (*mapping.Executor, error)

NewBloblangMapping parses a bloblang mapping using either the global environment, or, when the provided manager supports the newer BloblEnvironment method, the manager environment.

func ProbeCache added in v3.47.0

func ProbeCache(ctx context.Context, mgr types.Manager, name string) error

ProbeCache checks whether a cache resource has been configured, and returns an error if not.

func ProbeInput added in v3.47.0

func ProbeInput(ctx context.Context, mgr types.Manager, name string) error

ProbeInput checks whether an input resource has been configured, and returns an error if not.

func ProbeOutput added in v3.47.0

func ProbeOutput(ctx context.Context, mgr types.Manager, name string) error

ProbeOutput checks whether an output resource has been configured, and returns an error if not.

func ProbeProcessor added in v3.47.0

func ProbeProcessor(ctx context.Context, mgr types.Manager, name string) error

ProbeProcessor checks whether a processor resource has been configured, and returns an error if not.

func ProbeRateLimit added in v3.47.0

func ProbeRateLimit(ctx context.Context, mgr types.Manager, name string) error

ProbeRateLimit checks whether a rate limit resource has been configured, and returns an error if not.

Types

This section is empty.

Directories

Path Synopsis
Package plugins provides a way to have the new components for plugins-v2 able to access and "pull" the old style plugins without introducing cyclic dependencies.
Package plugins provides a way to have the new components for plugins-v2 able to access and "pull" the old style plugins without introducing cyclic dependencies.

Jump to

Keyboard shortcuts

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