Documentation ¶
Index ¶
- type CallbackController
- func (c *CallbackController) Close() error
- func (c *CallbackController) Execute(ctx context.Context) error
- func (c *CallbackController) GetControllerID() string
- func (c *CallbackController) GetControllerInfo() *controller.Info
- func (c *CallbackController) HandleDirective(ctx context.Context, di directive.Instance) ([]directive.Resolver, error)
- type CloseFunc
- type ExecuteFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallbackController ¶
type CallbackController struct {
// contains filtered or unexported fields
}
CallbackController wraps a ExecuteFunc and/or HandlerFunc into a controller. This is a utility to quickly build controllers.
func NewCallbackController ¶
func NewCallbackController(info *controller.Info, execute ExecuteFunc, handleDir directive.HandlerFunc, closeFn CloseFunc) *CallbackController
NewCallbackController constructs a new CallbackController.
func (*CallbackController) Close ¶
func (c *CallbackController) Close() error
Close releases any resources used by the controller. Error indicates any issue encountered releasing.
func (*CallbackController) Execute ¶
func (c *CallbackController) Execute(ctx context.Context) error
Execute executes the controller goroutine. Returning nil ends execution. Returning an error triggers a retry with backoff.
func (*CallbackController) GetControllerID ¶
func (c *CallbackController) GetControllerID() string
GetControllerID returns the controller ID.
func (*CallbackController) GetControllerInfo ¶
func (c *CallbackController) GetControllerInfo() *controller.Info
GetControllerInfo returns information about the controller.
func (*CallbackController) HandleDirective ¶
func (c *CallbackController) 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.
type ExecuteFunc ¶
ExecuteFunc is the type for the execute function.