Documentation
¶
Index ¶
- type Constructor
- type Controller
- func (c *Controller) Close() error
- func (c *Controller) Execute(rctx context.Context) error
- func (c *Controller) GetControllerID() string
- func (c *Controller) GetControllerInfo() *controller.Info
- func (c *Controller) GetWebDocument() web_document.WebDocument
- func (c *Controller) HandleDirective(ctx context.Context, di directive.Instance) ([]directive.Resolver, error)
- func (c *Controller) HandleWebView(ctx context.Context, wv web_view.WebView)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Constructor ¶
type Constructor func( le *logrus.Entry, bus bus.Bus, handler web_document.WebDocumentHandler, webDocumentId string, ) (web_document.WebDocument, error)
Constructor constructs a runtime with common parameters.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller implements a common bldr WebDocument controller. Tracks attached WebDocument state and manages RPC calls in/out.
func NewController ¶
func NewController( le *logrus.Entry, bus bus.Bus, webDocumentId string, webDocumentVersion semver.Version, ctor Constructor, ) (*Controller, error)
NewController constructs a new WebDocument controller.
func (*Controller) Close ¶
func (c *Controller) Close() error
Close releases any resources used by the controller. Error indicates any issue encountered releasing.
func (*Controller) Execute ¶
func (c *Controller) Execute(rctx context.Context) error
Execute executes the WebDocument controller. Returning nil ends execution. Returning an error triggers a retry with backoff.
func (*Controller) GetControllerID ¶
func (c *Controller) GetControllerID() string
GetControllerID returns the controller ID.
func (*Controller) GetControllerInfo ¶
func (c *Controller) GetControllerInfo() *controller.Info
GetControllerInfo returns information about the controller.
func (*Controller) GetWebDocument ¶
func (c *Controller) GetWebDocument() web_document.WebDocument
GetWebDocument returns the controlled WebDocument.
func (*Controller) HandleDirective ¶
func (c *Controller) 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.
func (*Controller) HandleWebView ¶
func (c *Controller) HandleWebView(ctx context.Context, wv web_view.WebView)
HandleWebView handles an incoming WebView.