bus_bridge

package
v0.45.4 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ControllerID = "controllerbus/bus/bridge"

ControllerID is the controller identifier.

Variables

View Source
var Version = semver.MustParse("0.0.1")

Version is the API version.

Functions

This section is empty.

Types

type BusBridge

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

BusBridge forwards directives to a bus.

func NewBusBridge

func NewBusBridge(target bus.Bus, filterFn FilterFn) *BusBridge

NewBusBridge constructs a new bus bridge.

func (*BusBridge) Close

func (b *BusBridge) Close() error

Close releases any resources used by the controller. Error indicates any issue encountered releasing.

func (*BusBridge) Execute

func (b *BusBridge) Execute(ctx context.Context) error

Execute executes the given controller. Returning nil ends execution. Returning an error triggers a retry with backoff.

func (*BusBridge) GetControllerInfo

func (b *BusBridge) GetControllerInfo() *controller.Info

GetControllerInfo returns information about the controller.

func (*BusBridge) HandleDirective

func (b *BusBridge) HandleDirective(ctx context.Context, di directive.Instance) ([]directive.Resolver, error)

HandleDirective asks if the handler can resolve the directive. If it can, it returns a resolver. If not, returns nil. Any unexpected errors are returned for logging. It is safe to add a reference to the directive during this call. The context passed is canceled when the directive instance expires.

func (*BusBridge) SetDirectiveBridgeTarget

func (b *BusBridge) SetDirectiveBridgeTarget(target bus.Bus)

SetDirectiveBridgeTarget sets the target bus. must be called before HandleDirective and Execute (just after construct).

type BusBridgeResolver

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

BusBridgeResolver resolves directives by forwarding to another bus.

func NewBusBridgeResolver

func NewBusBridgeResolver(target bus.Bus, dir directive.Directive) *BusBridgeResolver

NewBusBridgeResolver constructs a new BusBridgeResolver.

func (*BusBridgeResolver) Resolve

Resolve resolves the values, emitting them to the handler.

type FilterFn

type FilterFn = func(di directive.Instance) (bool, error)

FilterFn filters directive instances for the bus bridge.

Jump to

Keyboard shortcuts

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