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

controller

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller added in v0.19.0

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

Controller manages running directives and handlers.

func NewController added in v0.19.0

func NewController(ctx context.Context, le *logrus.Entry) *Controller

NewController builds a new directive controller.

func (*Controller) AddDirective added in v0.19.0

AddDirective adds a directive to the controller. This call de-duplicates equivalent directives.

cb receives values in order as they are emitted. cb can be nil. cb should not block.

Returns the instance, new reference, and anynke error.

func (*Controller) AddHandler added in v0.19.0

func (c *Controller) AddHandler(handler directive.Handler) (func(), error)

AddHandler adds a directive handler. The handler will receive calls for all existing directives (initial set). An error is returned only if adding the handler failed. Returns a function to remove the handler. The release function must be non-nil if err is nil, and nil if err != nil.

func (*Controller) GetDirectives added in v0.19.0

func (c *Controller) GetDirectives() []directive.Instance

GetDirectives returns a list of all currently executing directives.

Jump to

Keyboard shortcuts

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