Help us shape the future of Go! Take the 2026 Go Developer Survey

inmem

package
v0.53.5 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bus

type Bus struct {
	// Controller is the directive controller.
	directive.Controller
	// contains filtered or unexported fields
}

Bus is an in-memory controller bus.

func NewBus

func NewBus(dc directive.Controller) *Bus

NewBus constructs a new in-memory Bus with a directive controller.

func NewBusWithLogger added in v0.53.5

func NewBusWithLogger(dc directive.Controller, le *logrus.Entry) *Bus

NewBusWithLogger constructs a new in-memory Bus with a directive controller and lifecycle logger.

func (*Bus) AddController added in v0.16.0

func (b *Bus) AddController(ctx context.Context, ctrl controller.Controller, cb func(exitErr error)) (func(), error)

AddController attaches a controller and calls Execute asynchronously. Its release function cancels, detaches, waits for Execute, closes once, and reports the lifecycle result through cb before returning.

func (*Bus) Close added in v0.53.5

func (b *Bus) Close() error

Close rejects admission and joins every retained controller lifetime.

func (*Bus) ExecuteController

func (b *Bus) ExecuteController(ctx context.Context, c controller.Controller) error

ExecuteController attaches a controller and calls Execute synchronously. A nil return leaves the controller attached for RemoveController. A terminal failure finalizes the attachment before returning.

func (*Bus) GetControllers

func (b *Bus) GetControllers() []controller.Controller

GetControllers returns a list of all currently active controllers.

func (*Bus) GetControllersBroadcast added in v0.53.1

func (b *Bus) GetControllersBroadcast() *broadcast.Broadcast

GetControllersBroadcast returns the broadcast that is signaled when controllers are added or removed from the bus.

func (*Bus) RemoveController

func (b *Bus) RemoveController(c controller.Controller)

RemoveController synchronously finalizes one attached controller instance.

Jump to

Keyboard shortcuts

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