component

package
v4.63.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTimeout    = errors.New("action timed out")
	ErrTypeClosed = errors.New("type was closed")

	ErrNotConnected = errors.New("not connected to target source or sink")

	// ErrAlreadyStarted is returned when an input or output type gets started a
	// second time.
	ErrAlreadyStarted = errors.New("type has already been started")

	ErrNoAck = errors.New("failed to receive acknowledgement")

	ErrFailedSend = errors.New("message failed to reach a target destination")
)

Errors used throughout the codebase.

View Source
var (
	ErrInputNotFound     = errors.New("input not found")
	ErrCacheNotFound     = errors.New("cache not found")
	ErrProcessorNotFound = errors.New("processor not found")
	ErrRateLimitNotFound = errors.New("rate limit not found")
	ErrOutputNotFound    = errors.New("output not found")
	ErrKeyAlreadyExists  = errors.New("key already exists")
	ErrKeyNotFound       = errors.New("key does not exist")
	ErrPipeNotFound      = errors.New("pipe was not found")
)

Manager errors.

View Source
var ErrConnectionTestNotSupported = errors.New("this component does not support testing connections")

ErrConnectionTestNotSupported is returned by components that cannot yet test their connections.

View Source
var (
	ErrMessageTooLarge = errors.New("message body larger than buffer space")
)

Buffer errors.

View Source
var ErrNotUnwrapped = errors.New("something has gone wrong during the registering of this component, please open an issue https://github.com/redpanda-data/benthos/issues/new to let us know")

ErrNotUnwrapped is returned in cases where a component was meant to be unwrapped either from the public packages or to the public packages but for some reason this did not happen. Unwrapping should only occur in times when it's guaranteed to succeed, so this error indicates that an assumption was incorrect during the migration of certain components which will need to be immediately addressed by maintainers.

Functions

func ErrInvalidType

func ErrInvalidType(typeStr, tried string) error

ErrInvalidType creates an error that describes a component type being initialized with an unrecognised implementation.

Types

type ConnectionStatus added in v4.31.0

type ConnectionStatus struct {
	Label     string
	Path      []string
	Connected bool
	Err       error
}

ConnectionStatus represents the current connection status of a given component.

func ConnectionActive added in v4.31.0

func ConnectionActive(o Observability) *ConnectionStatus

ConnectionActive returns a ConnectionStatus representing a component connection where we have an active connection.

func ConnectionClosed added in v4.31.0

func ConnectionClosed(o Observability) *ConnectionStatus

ConnectionClosed returns a ConnectionStatus representing a component that has intentionally closed its connection.

func ConnectionFailing added in v4.31.0

func ConnectionFailing(o Observability, err error) *ConnectionStatus

ConnectionFailing returns a ConnectionStatus representing a component connection where we are attempting to connect to the service but are currently unable due to the provided error.

func ConnectionPending added in v4.31.0

func ConnectionPending(o Observability) *ConnectionStatus

ConnectionPending returns a ConnectionStatus representing a component that has not yet attempted to establish its connection.

type ConnectionStatuses added in v4.31.0

type ConnectionStatuses []*ConnectionStatus

ConnectionStatuses represents an aggregate of connection statuses.

func (ConnectionStatuses) AllActive added in v4.31.0

func (s ConnectionStatuses) AllActive() bool

AllActive returns true if there is one or more connections and they are all active.

type ConnectionTestResult added in v4.63.0

type ConnectionTestResult struct {
	Label string
	Path  []string
	Err   error
}

ConnectionTestResult represents the result of a connection test.

func ConnectionTestFailed added in v4.63.0

func ConnectionTestFailed(o Observability, err error) *ConnectionTestResult

ConnectionTestFailed returns a failed connection test result.

func ConnectionTestNotSupported added in v4.63.0

func ConnectionTestNotSupported(o Observability) *ConnectionTestResult

ConnectionTestNotSupported returns a test result indicating that the component does not support testing connections.

func ConnectionTestSucceeded added in v4.63.0

func ConnectionTestSucceeded(o Observability) *ConnectionTestResult

ConnectionTestSucceeded returns a successful connection test result.

func (*ConnectionTestResult) AsList added in v4.63.0

AsList returns an aggregated list of connection results containing only the target. This is convenient for components that only have one connection to test.

type ConnectionTestResults added in v4.63.0

type ConnectionTestResults []*ConnectionTestResult

ConnectionTestResults represents an aggregate of connection test results.

type ErrBackOff

type ErrBackOff struct {
	Err  error
	Wait time.Duration
}

ErrBackOff is an error returned that allows for a back off duration to be specified

func (*ErrBackOff) Error

func (e *ErrBackOff) Error() string

Error returns the Error string.

type Observability

type Observability interface {
	Metrics() metrics.Type
	Logger() log.Modular
	Tracer() trace.TracerProvider
	Path() []string
	Label() string
}

Observability is an interface implemented by components that provide a range of observability APIs to components. This is primarily done the service-wide managers.

func NoopObservability

func NoopObservability() Observability

NoopObservability returns an implementation of Observability that does nothing.

Directories

Path Synopsis
config
Package config contains reusable config definitions and parsers for inputs defined via the public/service package.
Package config contains reusable config definitions and parsers for inputs defined via the public/service package.

Jump to

Keyboard shortcuts

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