Documentation
¶
Index ¶
- Constants
- Variables
- func HandleWebViewViaClient(ctx context.Context, client SRPCHandleWebViewServiceClient, ...) error
- func NewHandleWebViewResolverWithRetry(le *logrus.Entry, dir web_view.HandleWebView, handler WebViewHandler) *directive.RetryResolver
- func NewHandleWebViewViaBusController(le *logrus.Entry, b bus.Bus, accessClient web_view.SRPCAccessWebViewsClient) *bifrost_rpc.InvokerController
- func NewSRPCHandleWebViewServiceHandler(impl SRPCHandleWebViewServiceServer, serviceID string) srpc.Handler
- func SRPCRegisterHandleWebViewService(mux srpc.Mux, impl SRPCHandleWebViewServiceServer) error
- func SetRenderModeWithRefresh() func(m *web_view.SetRenderModeRequest)
- type HandleWebViewRequest
- func (m *HandleWebViewRequest) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *HandleWebViewRequest) CloneVT() *HandleWebViewRequest
- func (this *HandleWebViewRequest) EqualMessageVT(thatMsg any) bool
- func (this *HandleWebViewRequest) EqualVT(that *HandleWebViewRequest) bool
- func (x *HandleWebViewRequest) GetDocumentId() string
- func (x *HandleWebViewRequest) GetId() string
- func (x *HandleWebViewRequest) GetParentId() string
- func (x *HandleWebViewRequest) GetPermanent() bool
- func (x *HandleWebViewRequest) MarshalJSON() ([]byte, error)
- func (x *HandleWebViewRequest) MarshalProtoJSON(s *json.MarshalState)
- func (x *HandleWebViewRequest) MarshalProtoText() string
- func (m *HandleWebViewRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *HandleWebViewRequest) MarshalToVT(dAtA []byte) (int, error)
- func (m *HandleWebViewRequest) MarshalVT() (dAtA []byte, err error)
- func (*HandleWebViewRequest) ProtoMessage()
- func (x *HandleWebViewRequest) Reset()
- func (m *HandleWebViewRequest) SizeVT() (n int)
- func (x *HandleWebViewRequest) String() string
- func (x *HandleWebViewRequest) UnmarshalJSON(b []byte) error
- func (x *HandleWebViewRequest) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *HandleWebViewRequest) UnmarshalVT(dAtA []byte) error
- type HandleWebViewResolver
- type HandleWebViewResponse
- func (m *HandleWebViewResponse) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *HandleWebViewResponse) CloneVT() *HandleWebViewResponse
- func (this *HandleWebViewResponse) EqualMessageVT(thatMsg any) bool
- func (this *HandleWebViewResponse) EqualVT(that *HandleWebViewResponse) bool
- func (x *HandleWebViewResponse) GetError() string
- func (x *HandleWebViewResponse) MarshalJSON() ([]byte, error)
- func (x *HandleWebViewResponse) MarshalProtoJSON(s *json.MarshalState)
- func (x *HandleWebViewResponse) MarshalProtoText() string
- func (m *HandleWebViewResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *HandleWebViewResponse) MarshalToVT(dAtA []byte) (int, error)
- func (m *HandleWebViewResponse) MarshalVT() (dAtA []byte, err error)
- func (*HandleWebViewResponse) ProtoMessage()
- func (x *HandleWebViewResponse) Reset()
- func (m *HandleWebViewResponse) SizeVT() (n int)
- func (x *HandleWebViewResponse) String() string
- func (x *HandleWebViewResponse) UnmarshalJSON(b []byte) error
- func (x *HandleWebViewResponse) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *HandleWebViewResponse) UnmarshalVT(dAtA []byte) error
- type HandleWebViewViaBus
- type SRPCHandleWebViewServiceClient
- type SRPCHandleWebViewServiceHandler
- func (SRPCHandleWebViewServiceHandler) GetMethodIDs() []string
- func (d *SRPCHandleWebViewServiceHandler) GetServiceID() string
- func (d *SRPCHandleWebViewServiceHandler) InvokeMethod(serviceID, methodID string, strm srpc.Stream) (bool, error)
- func (SRPCHandleWebViewServiceHandler) InvokeMethod_HandleWebView(impl SRPCHandleWebViewServiceServer, strm srpc.Stream) error
- type SRPCHandleWebViewServiceServer
- type SRPCHandleWebViewService_HandleWebViewStream
- type WebViewHandler
- func MergeWebViewHandlers(handlers ...WebViewHandler) WebViewHandler
- func NewSetFunctionComponent(le *logrus.Entry, scriptPath string, props []byte) WebViewHandler
- func NewSetHtmlLinks(le *logrus.Entry, req *web_view.SetHtmlLinksRequest) WebViewHandler
- func NewSetReactComponent(le *logrus.Entry, scriptPath string, props []byte, ...) WebViewHandler
- func NewSetRenderMode(le *logrus.Entry, req *web_view.SetRenderModeRequest, ...) WebViewHandler
- func NewViaBusHandler(le *logrus.Entry, b bus.Bus, returnIfErr bool) WebViewHandler
- func NewWebViewHandlerFromConfig(le *logrus.Entry, config *WebViewHandlerConfig) (WebViewHandler, error)
- type WebViewHandlerConfig
- func (m *WebViewHandlerConfig) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *WebViewHandlerConfig) CloneVT() *WebViewHandlerConfig
- func (this *WebViewHandlerConfig) EqualMessageVT(thatMsg any) bool
- func (this *WebViewHandlerConfig) EqualVT(that *WebViewHandlerConfig) bool
- func (m *WebViewHandlerConfig) GetHandler() isWebViewHandlerConfig_Handler
- func (x *WebViewHandlerConfig) GetSetHtmlLinks() *view.SetHtmlLinksRequest
- func (x *WebViewHandlerConfig) GetSetRenderMode() *view.SetRenderModeRequest
- func (x *WebViewHandlerConfig) GetWebViewId() *filter.StringFilter
- func (x *WebViewHandlerConfig) GetWebViewParentId() *filter.StringFilter
- func (x *WebViewHandlerConfig) MarshalJSON() ([]byte, error)
- func (x *WebViewHandlerConfig) MarshalProtoJSON(s *json.MarshalState)
- func (x *WebViewHandlerConfig) MarshalProtoText() string
- func (m *WebViewHandlerConfig) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *WebViewHandlerConfig) MarshalToVT(dAtA []byte) (int, error)
- func (m *WebViewHandlerConfig) MarshalVT() (dAtA []byte, err error)
- func (*WebViewHandlerConfig) ProtoMessage()
- func (x *WebViewHandlerConfig) Reset()
- func (m *WebViewHandlerConfig) SizeVT() (n int)
- func (x *WebViewHandlerConfig) String() string
- func (x *WebViewHandlerConfig) UnmarshalJSON(b []byte) error
- func (x *WebViewHandlerConfig) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *WebViewHandlerConfig) UnmarshalVT(dAtA []byte) error
- func (m *WebViewHandlerConfig) Validate() error
- type WebViewHandlerConfig_SetHtmlLinks
- func (m *WebViewHandlerConfig_SetHtmlLinks) CloneOneofVT() isWebViewHandlerConfig_Handler
- func (m *WebViewHandlerConfig_SetHtmlLinks) CloneVT() *WebViewHandlerConfig_SetHtmlLinks
- func (this *WebViewHandlerConfig_SetHtmlLinks) EqualVT(thatIface isWebViewHandlerConfig_Handler) bool
- func (m *WebViewHandlerConfig_SetHtmlLinks) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *WebViewHandlerConfig_SetHtmlLinks) MarshalToVT(dAtA []byte) (int, error)
- func (m *WebViewHandlerConfig_SetHtmlLinks) SizeVT() (n int)
- type WebViewHandlerConfig_SetRenderMode
- func (m *WebViewHandlerConfig_SetRenderMode) CloneOneofVT() isWebViewHandlerConfig_Handler
- func (m *WebViewHandlerConfig_SetRenderMode) CloneVT() *WebViewHandlerConfig_SetRenderMode
- func (this *WebViewHandlerConfig_SetRenderMode) EqualVT(thatIface isWebViewHandlerConfig_Handler) bool
- func (m *WebViewHandlerConfig_SetRenderMode) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *WebViewHandlerConfig_SetRenderMode) MarshalToVT(dAtA []byte) (int, error)
- func (m *WebViewHandlerConfig_SetRenderMode) SizeVT() (n int)
- type WebViewHandlerWithFilters
- type WebViewHandlersConfig
- func (m *WebViewHandlersConfig) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *WebViewHandlersConfig) CloneVT() *WebViewHandlersConfig
- func (this *WebViewHandlersConfig) EqualMessageVT(thatMsg any) bool
- func (this *WebViewHandlersConfig) EqualVT(that *WebViewHandlersConfig) bool
- func (x *WebViewHandlersConfig) GetHandlers() []*WebViewHandlerConfig
- func (x *WebViewHandlersConfig) GetWebViewId() *filter.StringFilter
- func (x *WebViewHandlersConfig) GetWebViewParentId() *filter.StringFilter
- func (x *WebViewHandlersConfig) MarshalJSON() ([]byte, error)
- func (x *WebViewHandlersConfig) MarshalProtoJSON(s *json.MarshalState)
- func (x *WebViewHandlersConfig) MarshalProtoText() string
- func (m *WebViewHandlersConfig) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *WebViewHandlersConfig) MarshalToVT(dAtA []byte) (int, error)
- func (m *WebViewHandlersConfig) MarshalVT() (dAtA []byte, err error)
- func (*WebViewHandlersConfig) ProtoMessage()
- func (x *WebViewHandlersConfig) Reset()
- func (m *WebViewHandlersConfig) SizeVT() (n int)
- func (x *WebViewHandlersConfig) String() string
- func (x *WebViewHandlersConfig) UnmarshalJSON(b []byte) error
- func (x *WebViewHandlersConfig) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *WebViewHandlersConfig) UnmarshalVT(dAtA []byte) error
- func (m *WebViewHandlersConfig) Validate() error
- type WebViewHandlersWithFilters
Constants ¶
const HandleWebViewViaBusControllerID = "bldr/web/view/handler/via-bus"
HandleWebViewViaBusControllerID is the controller ID used for HandleWebViewViaBus.
const SRPCHandleWebViewServiceServiceID = "web.view.handler.HandleWebViewService"
Variables ¶
var HandleWebViewViaBusVersion = semver.MustParse("0.0.1")
HandleWebViewViaBusVersion is the controller version used for HandleWebViewViaBus.
Functions ¶
func HandleWebViewViaClient ¶
func HandleWebViewViaClient( ctx context.Context, client SRPCHandleWebViewServiceClient, webView web_view.WebView, ) error
HandleWebViewViaClient handles the web view via the SRPC client.
func NewHandleWebViewResolverWithRetry ¶
func NewHandleWebViewResolverWithRetry(le *logrus.Entry, dir web_view.HandleWebView, handler WebViewHandler) *directive.RetryResolver
NewHandleWebViewResolverWithRetry builds the HandleWebViewResolver with a RetryResolver.
func NewHandleWebViewViaBusController ¶
func NewHandleWebViewViaBusController( le *logrus.Entry, b bus.Bus, accessClient web_view.SRPCAccessWebViewsClient, ) *bifrost_rpc.InvokerController
NewHandleWebViewViaBusController constructs a new controller resolving LookupRpcService with the HandleWebViewViaBus service.
func NewSRPCHandleWebViewServiceHandler ¶
func NewSRPCHandleWebViewServiceHandler(impl SRPCHandleWebViewServiceServer, serviceID string) srpc.Handler
NewSRPCHandleWebViewServiceHandler constructs a new RPC handler. serviceID: if empty, uses default: web.view.handler.HandleWebViewService
func SRPCRegisterHandleWebViewService ¶
func SRPCRegisterHandleWebViewService(mux srpc.Mux, impl SRPCHandleWebViewServiceServer) error
SRPCRegisterHandleWebViewService registers the implementation with the mux. Uses the default serviceID: web.view.handler.HandleWebViewService
func SetRenderModeWithRefresh ¶
func SetRenderModeWithRefresh() func(m *web_view.SetRenderModeRequest)
SetRenderModeWithRefresh is an option to enable Clear on SetRenderMode.
Types ¶
type HandleWebViewRequest ¶
type HandleWebViewRequest struct {
// Id is the unique identifier for the webview.
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// ParentId is the identifier of the parent WebView.
// May be empty.
ParentId string `protobuf:"bytes,2,opt,name=parent_id,json=parentId,proto3" json:"parentId,omitempty"`
// DocumentId is the identifier of the parent WebDocument.
// May be empty.
DocumentId string `protobuf:"bytes,3,opt,name=document_id,json=documentId,proto3" json:"documentId,omitempty"`
// Permanent indicates that this is a "root" webview and cannot be closed.
Permanent bool `protobuf:"varint,4,opt,name=permanent,proto3" json:"permanent,omitempty"`
// contains filtered or unexported fields
}
HandleWebViewRequest is a request to handle a web view.
func NewHandleWebViewRequest ¶
func NewHandleWebViewRequest(id, parent, documentID string, permanent bool) *HandleWebViewRequest
NewHandleWebViewRequest constructs a request from a web view.
func (*HandleWebViewRequest) CloneMessageVT ¶
func (m *HandleWebViewRequest) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*HandleWebViewRequest) CloneVT ¶
func (m *HandleWebViewRequest) CloneVT() *HandleWebViewRequest
func (*HandleWebViewRequest) EqualMessageVT ¶
func (this *HandleWebViewRequest) EqualMessageVT(thatMsg any) bool
func (*HandleWebViewRequest) EqualVT ¶
func (this *HandleWebViewRequest) EqualVT(that *HandleWebViewRequest) bool
func (*HandleWebViewRequest) GetDocumentId ¶
func (x *HandleWebViewRequest) GetDocumentId() string
func (*HandleWebViewRequest) GetId ¶
func (x *HandleWebViewRequest) GetId() string
func (*HandleWebViewRequest) GetParentId ¶
func (x *HandleWebViewRequest) GetParentId() string
func (*HandleWebViewRequest) GetPermanent ¶
func (x *HandleWebViewRequest) GetPermanent() bool
func (*HandleWebViewRequest) MarshalJSON ¶
func (x *HandleWebViewRequest) MarshalJSON() ([]byte, error)
MarshalJSON marshals the HandleWebViewRequest to JSON.
func (*HandleWebViewRequest) MarshalProtoJSON ¶
func (x *HandleWebViewRequest) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the HandleWebViewRequest message to JSON.
func (*HandleWebViewRequest) MarshalProtoText ¶
func (x *HandleWebViewRequest) MarshalProtoText() string
func (*HandleWebViewRequest) MarshalToSizedBufferVT ¶
func (m *HandleWebViewRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*HandleWebViewRequest) MarshalToVT ¶
func (m *HandleWebViewRequest) MarshalToVT(dAtA []byte) (int, error)
func (*HandleWebViewRequest) MarshalVT ¶
func (m *HandleWebViewRequest) MarshalVT() (dAtA []byte, err error)
func (*HandleWebViewRequest) ProtoMessage ¶
func (*HandleWebViewRequest) ProtoMessage()
func (*HandleWebViewRequest) Reset ¶
func (x *HandleWebViewRequest) Reset()
func (*HandleWebViewRequest) SizeVT ¶
func (m *HandleWebViewRequest) SizeVT() (n int)
func (*HandleWebViewRequest) String ¶
func (x *HandleWebViewRequest) String() string
func (*HandleWebViewRequest) UnmarshalJSON ¶
func (x *HandleWebViewRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the HandleWebViewRequest from JSON.
func (*HandleWebViewRequest) UnmarshalProtoJSON ¶
func (x *HandleWebViewRequest) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the HandleWebViewRequest message from JSON.
func (*HandleWebViewRequest) UnmarshalVT ¶
func (m *HandleWebViewRequest) UnmarshalVT(dAtA []byte) error
type HandleWebViewResolver ¶
type HandleWebViewResolver struct {
// contains filtered or unexported fields
}
HandleWebViewResolver resolves HandleWebView with a WebViewHandler.
func NewHandleWebViewResolver ¶
func NewHandleWebViewResolver( dir web_view.HandleWebView, handler WebViewHandler, ) *HandleWebViewResolver
NewHandleWebViewResolver returns a new HandleWebViewResolver.
func (*HandleWebViewResolver) Resolve ¶
func (r *HandleWebViewResolver) Resolve(ctx context.Context, handler directive.ResolverHandler) error
Resolve resolves the values, emitting them to the handler.
type HandleWebViewResponse ¶
type HandleWebViewResponse struct {
// Error contains any error handling the web view.
// If empty, returns and does not retry.
Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
// contains filtered or unexported fields
}
HandleWebViewResponse is a response to handle a web view.
func (*HandleWebViewResponse) CloneMessageVT ¶
func (m *HandleWebViewResponse) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*HandleWebViewResponse) CloneVT ¶
func (m *HandleWebViewResponse) CloneVT() *HandleWebViewResponse
func (*HandleWebViewResponse) EqualMessageVT ¶
func (this *HandleWebViewResponse) EqualMessageVT(thatMsg any) bool
func (*HandleWebViewResponse) EqualVT ¶
func (this *HandleWebViewResponse) EqualVT(that *HandleWebViewResponse) bool
func (*HandleWebViewResponse) GetError ¶
func (x *HandleWebViewResponse) GetError() string
func (*HandleWebViewResponse) MarshalJSON ¶
func (x *HandleWebViewResponse) MarshalJSON() ([]byte, error)
MarshalJSON marshals the HandleWebViewResponse to JSON.
func (*HandleWebViewResponse) MarshalProtoJSON ¶
func (x *HandleWebViewResponse) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the HandleWebViewResponse message to JSON.
func (*HandleWebViewResponse) MarshalProtoText ¶
func (x *HandleWebViewResponse) MarshalProtoText() string
func (*HandleWebViewResponse) MarshalToSizedBufferVT ¶
func (m *HandleWebViewResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*HandleWebViewResponse) MarshalToVT ¶
func (m *HandleWebViewResponse) MarshalToVT(dAtA []byte) (int, error)
func (*HandleWebViewResponse) MarshalVT ¶
func (m *HandleWebViewResponse) MarshalVT() (dAtA []byte, err error)
func (*HandleWebViewResponse) ProtoMessage ¶
func (*HandleWebViewResponse) ProtoMessage()
func (*HandleWebViewResponse) Reset ¶
func (x *HandleWebViewResponse) Reset()
func (*HandleWebViewResponse) SizeVT ¶
func (m *HandleWebViewResponse) SizeVT() (n int)
func (*HandleWebViewResponse) String ¶
func (x *HandleWebViewResponse) String() string
func (*HandleWebViewResponse) UnmarshalJSON ¶
func (x *HandleWebViewResponse) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the HandleWebViewResponse from JSON.
func (*HandleWebViewResponse) UnmarshalProtoJSON ¶
func (x *HandleWebViewResponse) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the HandleWebViewResponse message from JSON.
func (*HandleWebViewResponse) UnmarshalVT ¶
func (m *HandleWebViewResponse) UnmarshalVT(dAtA []byte) error
type HandleWebViewViaBus ¶
type HandleWebViewViaBus struct {
// contains filtered or unexported fields
}
HandleWebViewViaBus implements the HandleWebView service.
func NewHandleWebViewViaBus ¶
func NewHandleWebViewViaBus( le *logrus.Entry, b bus.Bus, accessClient web_view.SRPCAccessWebViewsClient, ) *HandleWebViewViaBus
NewHandleWebViewViaBus constructs a HandleWebViewViaBus service.
func (*HandleWebViewViaBus) HandleWebView ¶
func (h *HandleWebViewViaBus) HandleWebView( ctx context.Context, req *HandleWebViewRequest, ) (*HandleWebViewResponse, error)
HandleWebView handles a web view via the HandleWebView directive.
type SRPCHandleWebViewServiceClient ¶
type SRPCHandleWebViewServiceClient interface {
// SRPCClient returns the underlying SRPC client.
SRPCClient() srpc.Client
// HandleWebView handles a web view via rpc.
// The RPC will be held open while the handler runs.
// The RPC is canceled if the WebView is removed.
// The handler can access the WebView service via AccessWebViews.
HandleWebView(ctx context.Context, in *HandleWebViewRequest) (*HandleWebViewResponse, error)
}
func NewSRPCHandleWebViewServiceClient ¶
func NewSRPCHandleWebViewServiceClient(cc srpc.Client) SRPCHandleWebViewServiceClient
func NewSRPCHandleWebViewServiceClientWithServiceID ¶
func NewSRPCHandleWebViewServiceClientWithServiceID(cc srpc.Client, serviceID string) SRPCHandleWebViewServiceClient
type SRPCHandleWebViewServiceHandler ¶
type SRPCHandleWebViewServiceHandler struct {
// contains filtered or unexported fields
}
func (SRPCHandleWebViewServiceHandler) GetMethodIDs ¶
func (SRPCHandleWebViewServiceHandler) GetMethodIDs() []string
func (*SRPCHandleWebViewServiceHandler) GetServiceID ¶
func (d *SRPCHandleWebViewServiceHandler) GetServiceID() string
func (*SRPCHandleWebViewServiceHandler) InvokeMethod ¶
func (SRPCHandleWebViewServiceHandler) InvokeMethod_HandleWebView ¶
func (SRPCHandleWebViewServiceHandler) InvokeMethod_HandleWebView(impl SRPCHandleWebViewServiceServer, strm srpc.Stream) error
type SRPCHandleWebViewServiceServer ¶
type SRPCHandleWebViewServiceServer interface {
// HandleWebView handles a web view via rpc.
// The RPC will be held open while the handler runs.
// The RPC is canceled if the WebView is removed.
// The handler can access the WebView service via AccessWebViews.
HandleWebView(context.Context, *HandleWebViewRequest) (*HandleWebViewResponse, error)
}
type WebViewHandler ¶
WebViewHandler handles a WebView.
func MergeWebViewHandlers ¶
func MergeWebViewHandlers(handlers ...WebViewHandler) WebViewHandler
MergeWebViewHandlers merges multiple handlers into a single WebViewHandler.
Calls all handlers concurrently, returns first error.
func NewSetFunctionComponent ¶
func NewSetFunctionComponent(le *logrus.Entry, scriptPath string, props []byte) WebViewHandler
NewSetFunctionComponent builds a handler that sets a function callback component.
le can be empty props can be nil (undefined)
func NewSetHtmlLinks ¶
func NewSetHtmlLinks(le *logrus.Entry, req *web_view.SetHtmlLinksRequest) WebViewHandler
NewSetHtmlLinks builds a new handler that sets html links.
le can be nil
func NewSetReactComponent ¶
func NewSetReactComponent(le *logrus.Entry, scriptPath string, props []byte, opts ...func(r *web_view.SetRenderModeRequest)) WebViewHandler
NewSetReactComponent builds a handler that sets a react component.
le can be empty
func NewSetRenderMode ¶
func NewSetRenderMode(le *logrus.Entry, req *web_view.SetRenderModeRequest, opts ...func(r *web_view.SetRenderModeRequest)) WebViewHandler
NewSetRenderMode builds a new handler that sets the render mode.
le can be nil
func NewViaBusHandler ¶
NewViaBusHandler handles the WebView via the HandleWebView directive.
If returnIfErr is set, returns an error if any of the resolvers fail. returnIfErr should be set to true in most cases.
func NewWebViewHandlerFromConfig ¶
func NewWebViewHandlerFromConfig(le *logrus.Entry, config *WebViewHandlerConfig) (WebViewHandler, error)
NewWebViewHandlerFromConfig constructs a WebViewHandler from WebViewHandlerConfig.
type WebViewHandlerConfig ¶
type WebViewHandlerConfig struct {
// WebViewId filters by web view id (specific to this handler).
WebViewId *filter.StringFilter `protobuf:"bytes,1,opt,name=web_view_id,json=webViewId,proto3" json:"webViewId,omitempty"`
// WebViewParentId filters by web view parent id (specific to this handler).
WebViewParentId *filter.StringFilter `protobuf:"bytes,2,opt,name=web_view_parent_id,json=webViewParentId,proto3" json:"webViewParentId,omitempty"`
// Handler configuration.
//
// Types that are assignable to Handler:
//
// *WebViewHandlerConfig_SetRenderMode
// *WebViewHandlerConfig_SetHtmlLinks
Handler isWebViewHandlerConfig_Handler `protobuf_oneof:"handler"`
// contains filtered or unexported fields
}
WebViewHandlerConfig configures a web view handler.
func (*WebViewHandlerConfig) CloneMessageVT ¶
func (m *WebViewHandlerConfig) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*WebViewHandlerConfig) CloneVT ¶
func (m *WebViewHandlerConfig) CloneVT() *WebViewHandlerConfig
func (*WebViewHandlerConfig) EqualMessageVT ¶
func (this *WebViewHandlerConfig) EqualMessageVT(thatMsg any) bool
func (*WebViewHandlerConfig) EqualVT ¶
func (this *WebViewHandlerConfig) EqualVT(that *WebViewHandlerConfig) bool
func (*WebViewHandlerConfig) GetHandler ¶
func (m *WebViewHandlerConfig) GetHandler() isWebViewHandlerConfig_Handler
func (*WebViewHandlerConfig) GetSetHtmlLinks ¶
func (x *WebViewHandlerConfig) GetSetHtmlLinks() *view.SetHtmlLinksRequest
func (*WebViewHandlerConfig) GetSetRenderMode ¶
func (x *WebViewHandlerConfig) GetSetRenderMode() *view.SetRenderModeRequest
func (*WebViewHandlerConfig) GetWebViewId ¶
func (x *WebViewHandlerConfig) GetWebViewId() *filter.StringFilter
func (*WebViewHandlerConfig) GetWebViewParentId ¶
func (x *WebViewHandlerConfig) GetWebViewParentId() *filter.StringFilter
func (*WebViewHandlerConfig) MarshalJSON ¶
func (x *WebViewHandlerConfig) MarshalJSON() ([]byte, error)
MarshalJSON marshals the WebViewHandlerConfig to JSON.
func (*WebViewHandlerConfig) MarshalProtoJSON ¶
func (x *WebViewHandlerConfig) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the WebViewHandlerConfig message to JSON.
func (*WebViewHandlerConfig) MarshalProtoText ¶
func (x *WebViewHandlerConfig) MarshalProtoText() string
func (*WebViewHandlerConfig) MarshalToSizedBufferVT ¶
func (m *WebViewHandlerConfig) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*WebViewHandlerConfig) MarshalToVT ¶
func (m *WebViewHandlerConfig) MarshalToVT(dAtA []byte) (int, error)
func (*WebViewHandlerConfig) MarshalVT ¶
func (m *WebViewHandlerConfig) MarshalVT() (dAtA []byte, err error)
func (*WebViewHandlerConfig) ProtoMessage ¶
func (*WebViewHandlerConfig) ProtoMessage()
func (*WebViewHandlerConfig) Reset ¶
func (x *WebViewHandlerConfig) Reset()
func (*WebViewHandlerConfig) SizeVT ¶
func (m *WebViewHandlerConfig) SizeVT() (n int)
func (*WebViewHandlerConfig) String ¶
func (x *WebViewHandlerConfig) String() string
func (*WebViewHandlerConfig) UnmarshalJSON ¶
func (x *WebViewHandlerConfig) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the WebViewHandlerConfig from JSON.
func (*WebViewHandlerConfig) UnmarshalProtoJSON ¶
func (x *WebViewHandlerConfig) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the WebViewHandlerConfig message from JSON.
func (*WebViewHandlerConfig) UnmarshalVT ¶
func (m *WebViewHandlerConfig) UnmarshalVT(dAtA []byte) error
func (*WebViewHandlerConfig) Validate ¶
func (m *WebViewHandlerConfig) Validate() error
Validate validates the WebViewHandlerConfig.
type WebViewHandlerConfig_SetHtmlLinks ¶
type WebViewHandlerConfig_SetHtmlLinks struct {
// SetHtmlLinksHandler sets html links.
SetHtmlLinks *view.SetHtmlLinksRequest `protobuf:"bytes,4,opt,name=set_html_links,json=setHtmlLinks,proto3,oneof"`
}
func (*WebViewHandlerConfig_SetHtmlLinks) CloneOneofVT ¶
func (m *WebViewHandlerConfig_SetHtmlLinks) CloneOneofVT() isWebViewHandlerConfig_Handler
func (*WebViewHandlerConfig_SetHtmlLinks) CloneVT ¶
func (m *WebViewHandlerConfig_SetHtmlLinks) CloneVT() *WebViewHandlerConfig_SetHtmlLinks
func (*WebViewHandlerConfig_SetHtmlLinks) EqualVT ¶
func (this *WebViewHandlerConfig_SetHtmlLinks) EqualVT(thatIface isWebViewHandlerConfig_Handler) bool
func (*WebViewHandlerConfig_SetHtmlLinks) MarshalToSizedBufferVT ¶
func (m *WebViewHandlerConfig_SetHtmlLinks) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*WebViewHandlerConfig_SetHtmlLinks) MarshalToVT ¶
func (m *WebViewHandlerConfig_SetHtmlLinks) MarshalToVT(dAtA []byte) (int, error)
func (*WebViewHandlerConfig_SetHtmlLinks) SizeVT ¶
func (m *WebViewHandlerConfig_SetHtmlLinks) SizeVT() (n int)
type WebViewHandlerConfig_SetRenderMode ¶
type WebViewHandlerConfig_SetRenderMode struct {
// SetRenderModeHandler sets the render mode.
SetRenderMode *view.SetRenderModeRequest `protobuf:"bytes,3,opt,name=set_render_mode,json=setRenderMode,proto3,oneof"`
}
func (*WebViewHandlerConfig_SetRenderMode) CloneOneofVT ¶
func (m *WebViewHandlerConfig_SetRenderMode) CloneOneofVT() isWebViewHandlerConfig_Handler
func (*WebViewHandlerConfig_SetRenderMode) CloneVT ¶
func (m *WebViewHandlerConfig_SetRenderMode) CloneVT() *WebViewHandlerConfig_SetRenderMode
func (*WebViewHandlerConfig_SetRenderMode) EqualVT ¶
func (this *WebViewHandlerConfig_SetRenderMode) EqualVT(thatIface isWebViewHandlerConfig_Handler) bool
func (*WebViewHandlerConfig_SetRenderMode) MarshalToSizedBufferVT ¶
func (m *WebViewHandlerConfig_SetRenderMode) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*WebViewHandlerConfig_SetRenderMode) MarshalToVT ¶
func (m *WebViewHandlerConfig_SetRenderMode) MarshalToVT(dAtA []byte) (int, error)
func (*WebViewHandlerConfig_SetRenderMode) SizeVT ¶
func (m *WebViewHandlerConfig_SetRenderMode) SizeVT() (n int)
type WebViewHandlerWithFilters ¶
type WebViewHandlerWithFilters struct {
// Handler is the wrapped WebViewHandler function.
Handler WebViewHandler
// WebViewIdFilter filters by web view id.
WebViewIdFilter *filter.StringFilter
// WebViewParentIdFilter filters by web view parent id.
WebViewParentIdFilter *filter.StringFilter
}
WebViewHandlerWithFilters wraps a WebViewHandler with string filters.
func (*WebViewHandlerWithFilters) CheckMatch ¶
func (h *WebViewHandlerWithFilters) CheckMatch(webViewId, webViewParentId string) bool
CheckMatch checks if the handler matches the given web view ID and parent ID.
func (*WebViewHandlerWithFilters) GetMatchingHandler ¶
func (h *WebViewHandlerWithFilters) GetMatchingHandler(webViewId, webViewParentId string) WebViewHandler
GetMatchingHandler returns the handler from WebViewHandlerWithFilters if it matches the given web view ID and parent ID.
type WebViewHandlersConfig ¶
type WebViewHandlersConfig struct {
// Handlers is the list of handler configurations to attach.
Handlers []*WebViewHandlerConfig `protobuf:"bytes,1,rep,name=handlers,proto3" json:"handlers,omitempty"`
// WebViewId filters by web view id (applies to all handlers if set).
WebViewId *filter.StringFilter `protobuf:"bytes,2,opt,name=web_view_id,json=webViewId,proto3" json:"webViewId,omitempty"`
// WebViewParentId filters by web view parent id (applies to all handlers if set).
WebViewParentId *filter.StringFilter `protobuf:"bytes,3,opt,name=web_view_parent_id,json=webViewParentId,proto3" json:"webViewParentId,omitempty"`
// contains filtered or unexported fields
}
WebViewHandlersConfig is a configuration for web view handlers.
func (*WebViewHandlersConfig) CloneMessageVT ¶
func (m *WebViewHandlersConfig) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*WebViewHandlersConfig) CloneVT ¶
func (m *WebViewHandlersConfig) CloneVT() *WebViewHandlersConfig
func (*WebViewHandlersConfig) EqualMessageVT ¶
func (this *WebViewHandlersConfig) EqualMessageVT(thatMsg any) bool
func (*WebViewHandlersConfig) EqualVT ¶
func (this *WebViewHandlersConfig) EqualVT(that *WebViewHandlersConfig) bool
func (*WebViewHandlersConfig) GetHandlers ¶
func (x *WebViewHandlersConfig) GetHandlers() []*WebViewHandlerConfig
func (*WebViewHandlersConfig) GetWebViewId ¶
func (x *WebViewHandlersConfig) GetWebViewId() *filter.StringFilter
func (*WebViewHandlersConfig) GetWebViewParentId ¶
func (x *WebViewHandlersConfig) GetWebViewParentId() *filter.StringFilter
func (*WebViewHandlersConfig) MarshalJSON ¶
func (x *WebViewHandlersConfig) MarshalJSON() ([]byte, error)
MarshalJSON marshals the WebViewHandlersConfig to JSON.
func (*WebViewHandlersConfig) MarshalProtoJSON ¶
func (x *WebViewHandlersConfig) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the WebViewHandlersConfig message to JSON.
func (*WebViewHandlersConfig) MarshalProtoText ¶
func (x *WebViewHandlersConfig) MarshalProtoText() string
func (*WebViewHandlersConfig) MarshalToSizedBufferVT ¶
func (m *WebViewHandlersConfig) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*WebViewHandlersConfig) MarshalToVT ¶
func (m *WebViewHandlersConfig) MarshalToVT(dAtA []byte) (int, error)
func (*WebViewHandlersConfig) MarshalVT ¶
func (m *WebViewHandlersConfig) MarshalVT() (dAtA []byte, err error)
func (*WebViewHandlersConfig) ProtoMessage ¶
func (*WebViewHandlersConfig) ProtoMessage()
func (*WebViewHandlersConfig) Reset ¶
func (x *WebViewHandlersConfig) Reset()
func (*WebViewHandlersConfig) SizeVT ¶
func (m *WebViewHandlersConfig) SizeVT() (n int)
func (*WebViewHandlersConfig) String ¶
func (x *WebViewHandlersConfig) String() string
func (*WebViewHandlersConfig) UnmarshalJSON ¶
func (x *WebViewHandlersConfig) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the WebViewHandlersConfig from JSON.
func (*WebViewHandlersConfig) UnmarshalProtoJSON ¶
func (x *WebViewHandlersConfig) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the WebViewHandlersConfig message from JSON.
func (*WebViewHandlersConfig) UnmarshalVT ¶
func (m *WebViewHandlersConfig) UnmarshalVT(dAtA []byte) error
func (*WebViewHandlersConfig) Validate ¶
func (m *WebViewHandlersConfig) Validate() error
Validate validates the WebViewHandlersConfig.
type WebViewHandlersWithFilters ¶
type WebViewHandlersWithFilters struct {
// Handlers is the list of handlers with their individual filters.
Handlers []WebViewHandlerWithFilters
// GlobalWebViewIdFilter filters by web view id (applies to all handlers).
GlobalWebViewIdFilter *filter.StringFilter
// GlobalWebViewParentIdFilter filters by web view parent id (applies to all handlers).
GlobalWebViewParentIdFilter *filter.StringFilter
}
WebViewHandlersWithFilters wraps multiple handlers with both global and per-handler filters.
func NewWebViewHandlersFromConfig ¶
func NewWebViewHandlersFromConfig(le *logrus.Entry, config *WebViewHandlersConfig) (*WebViewHandlersWithFilters, error)
NewWebViewHandlersFromConfig constructs WebViewHandlersWithFilters from WebViewHandlersConfig.
func (*WebViewHandlersWithFilters) CheckMatch ¶
func (h *WebViewHandlersWithFilters) CheckMatch(webViewId, webViewParentId string) bool
CheckMatch checks if the global filters match the given web view ID and parent ID, and that at least one handler also matches.
func (*WebViewHandlersWithFilters) GetMatchingHandlers ¶
func (h *WebViewHandlersWithFilters) GetMatchingHandlers(webViewId, webViewParentId string) []WebViewHandler
GetMatchingHandlers returns handlers from WebViewHandlersWithFilters that match the given web view ID and parent ID.