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
func (c *Controller) AddDirective( dir directive.Directive, ref directive.ReferenceHandler, ) (directive.Instance, directive.Reference, error)
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.