benthos_components

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyExists = errors.New("stream already exists")
	ErrNotFound      = errors.New("stream not found")
)

Functions

func IsLintError

func IsLintError(e error) bool

func NewErrLintError

func NewErrLintError(lintErrors []string) error

func NewServerMutator

func NewServerMutator(client client.Client, scheme *runtime.Scheme) controllerutils.Mutator[*benthosv1beta2.Server]

func NewStreamMutator

func NewStreamMutator(client client.Client, scheme *runtime.Scheme, api Api) controllerutils.Mutator[*benthosv1beta2.Stream]

Types

type Api

type Api interface {
	CreateStream(ctx context.Context, address string, id string, config string) error
	GetStream(ctx context.Context, address, id string) (*BenthosStream, error)
	UpdateStream(ctx context.Context, address string, id string, config string) error
	DeleteStream(ctx context.Context, address string, id string) error
}

type BenthosStream

type BenthosStream struct {
	Active    bool           `json:"active"`
	Uptime    float64        `json:"uptime"`
	UptimeStr string         `json:"uptime_str"`
	Config    map[string]any `json:"config"`
}

type DefaultApi

type DefaultApi struct {
}

func NewDefaultApi

func NewDefaultApi() *DefaultApi

func (*DefaultApi) CreateStream

func (a *DefaultApi) CreateStream(ctx context.Context, address string, id string, config string) error

func (*DefaultApi) DeleteStream

func (a *DefaultApi) DeleteStream(ctx context.Context, address string, id string) error

func (*DefaultApi) GetStream

func (a *DefaultApi) GetStream(ctx context.Context, address, id string) (*BenthosStream, error)

func (*DefaultApi) UpdateStream

func (a *DefaultApi) UpdateStream(ctx context.Context, address string, id string, config string) error

type ErrorResponse

type ErrorResponse struct {
	LintErrors []string `json:"lint_errors,omitempty"`
}

type ServerMutator

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

func (*ServerMutator) Mutate

func (m *ServerMutator) Mutate(ctx context.Context, server *benthosv1beta2.Server) (*ctrl.Result, error)

func (*ServerMutator) SetupWithBuilder

func (m *ServerMutator) SetupWithBuilder(mgr ctrl.Manager, blder *ctrl.Builder) error

type StreamMutator

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

func (*StreamMutator) Mutate

func (s *StreamMutator) Mutate(ctx context.Context, stream *benthosv1beta2.Stream) (*ctrl.Result, error)

func (*StreamMutator) SetupWithBuilder

func (s *StreamMutator) SetupWithBuilder(mgr ctrl.Manager, blder *ctrl.Builder) error

Jump to

Keyboard shortcuts

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