Documentation
¶
Index ¶
- Constants
- Variables
- func NewSRPCSaucerDebugServiceHandler(impl SRPCSaucerDebugServiceServer, serviceID string) srpc.Handler
- func SRPCRegisterSaucerDebugService(mux srpc.Mux, impl SRPCSaucerDebugServiceServer) error
- type Config
- func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *Config) CloneVT() *Config
- func (this *Config) EqualMessageVT(thatMsg any) bool
- func (this *Config) EqualVT(that *Config) bool
- func (c *Config) EqualsConfig(other config.Config) bool
- func (x *Config) GetAppName() string
- func (x *Config) GetBootstrapHtml() string
- func (c *Config) GetConfigID() string
- func (x *Config) GetDevTools() bool
- func (x *Config) GetEntrypointJs() string
- func (x *Config) GetExternalLinks() ExternalLinks
- func (x *Config) GetSaucerFlags() []string
- func (x *Config) GetSaucerPath() string
- func (x *Config) GetWebRuntimeId() string
- func (x *Config) GetWindowHeight() uint32
- func (x *Config) GetWindowTitle() string
- func (x *Config) GetWindowWidth() uint32
- func (x *Config) GetWorkdirPath() string
- func (x *Config) MarshalJSON() ([]byte, error)
- func (x *Config) MarshalProtoJSON(s *json.MarshalState)
- func (x *Config) MarshalProtoText() string
- func (m *Config) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Config) MarshalToVT(dAtA []byte) (int, error)
- func (m *Config) MarshalVT() (dAtA []byte, err error)
- func (*Config) ProtoMessage()
- func (x *Config) Reset()
- func (m *Config) SizeVT() (n int)
- func (x *Config) String() string
- func (x *Config) UnmarshalJSON(b []byte) error
- func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *Config) UnmarshalVT(dAtA []byte) error
- func (c *Config) Validate() error
- type Controller
- func (r *Controller) Close() error
- func (r *Controller) Execute(ctx context.Context) error
- func (r *Controller) GetBus() bus.Bus
- func (r *Controller) GetControllerInfo() *controller.Info
- func (r *Controller) GetLogger() *logrus.Entry
- func (r *Controller) HandleDirective(ctx context.Context, di directive.Instance) ([]directive.Resolver, error)
- func (r *Controller) WaitSaucer(ctx context.Context, errCh <-chan error) (*Saucer, error)
- type DocumentManager
- func (dm *DocumentManager) Close()
- func (dm *DocumentManager) CreateWebDocument(_ context.Context, _ *web_runtime.CreateWebDocumentRequest) (*web_runtime.CreateWebDocumentResponse, error)
- func (dm *DocumentManager) FlushIndexCache(_ context.Context, _ *web_runtime.FlushIndexCacheRequest) (*web_runtime.FlushIndexCacheResponse, error)
- func (dm *DocumentManager) GetDefaultDocID() string
- func (dm *DocumentManager) GetDocumentIDs() []string
- func (dm *DocumentManager) GetWebDocuments() map[string]*documentState
- func (dm *DocumentManager) GetWebRuntimeStatusCtr() *ccontainer.CContainer[*web_runtime.WebRuntimeStatus]
- func (dm *DocumentManager) HandleWebDocumentRpc(ctx context.Context, componentID string, _ func()) (srpc.Invoker, func(), error)
- func (dm *DocumentManager) RemoveWebDocument(_ context.Context, _ *web_runtime.RemoveWebDocumentRequest) (*web_runtime.RemoveWebDocumentResponse, error)
- func (dm *DocumentManager) ServeSaucerHTTP(rw http.ResponseWriter, req *http.Request)
- func (dm *DocumentManager) SetServer(srv *srpc.Server)
- func (dm *DocumentManager) WaitDefaultDoc(ctx context.Context) (string, error)
- func (dm *DocumentManager) WatchWebRuntimeStatus(_ *web_runtime.WatchWebRuntimeStatusRequest, ...) error
- func (dm *DocumentManager) WebDocumentOpenStream(ctx context.Context, msgHandler srpc.PacketDataHandler, ...) (srpc.PacketWriter, error)
- func (dm *DocumentManager) WebDocumentRpc(strm web_runtime.SRPCWebRuntime_WebDocumentRpcStream) error
- func (dm *DocumentManager) WebWorkerRpc(_ web_runtime.SRPCWebRuntime_WebWorkerRpcStream) error
- type EvalJSRequest
- func (m *EvalJSRequest) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *EvalJSRequest) CloneVT() *EvalJSRequest
- func (this *EvalJSRequest) EqualMessageVT(thatMsg any) bool
- func (this *EvalJSRequest) EqualVT(that *EvalJSRequest) bool
- func (x *EvalJSRequest) GetCode() string
- func (x *EvalJSRequest) MarshalJSON() ([]byte, error)
- func (x *EvalJSRequest) MarshalProtoJSON(s *json.MarshalState)
- func (x *EvalJSRequest) MarshalProtoText() string
- func (m *EvalJSRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *EvalJSRequest) MarshalToVT(dAtA []byte) (int, error)
- func (m *EvalJSRequest) MarshalVT() (dAtA []byte, err error)
- func (*EvalJSRequest) ProtoMessage()
- func (x *EvalJSRequest) Reset()
- func (m *EvalJSRequest) SizeVT() (n int)
- func (x *EvalJSRequest) String() string
- func (x *EvalJSRequest) UnmarshalJSON(b []byte) error
- func (x *EvalJSRequest) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *EvalJSRequest) UnmarshalVT(dAtA []byte) error
- type EvalJSResponse
- func (m *EvalJSResponse) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *EvalJSResponse) CloneVT() *EvalJSResponse
- func (this *EvalJSResponse) EqualMessageVT(thatMsg any) bool
- func (this *EvalJSResponse) EqualVT(that *EvalJSResponse) bool
- func (x *EvalJSResponse) GetError() string
- func (x *EvalJSResponse) GetResult() string
- func (x *EvalJSResponse) MarshalJSON() ([]byte, error)
- func (x *EvalJSResponse) MarshalProtoJSON(s *json.MarshalState)
- func (x *EvalJSResponse) MarshalProtoText() string
- func (m *EvalJSResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *EvalJSResponse) MarshalToVT(dAtA []byte) (int, error)
- func (m *EvalJSResponse) MarshalVT() (dAtA []byte, err error)
- func (*EvalJSResponse) ProtoMessage()
- func (x *EvalJSResponse) Reset()
- func (m *EvalJSResponse) SizeVT() (n int)
- func (x *EvalJSResponse) String() string
- func (x *EvalJSResponse) UnmarshalJSON(b []byte) error
- func (x *EvalJSResponse) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *EvalJSResponse) UnmarshalVT(dAtA []byte) error
- type ExternalLinks
- func (x ExternalLinks) Enum() *ExternalLinks
- func (x ExternalLinks) MarshalJSON() ([]byte, error)
- func (x ExternalLinks) MarshalProtoJSON(s *json.MarshalState)
- func (x ExternalLinks) MarshalProtoText() string
- func (x ExternalLinks) MarshalText() ([]byte, error)
- func (x ExternalLinks) String() string
- func (x *ExternalLinks) UnmarshalJSON(b []byte) error
- func (x *ExternalLinks) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (x *ExternalLinks) UnmarshalText(b []byte) error
- type Factory
- func (t *Factory) Construct(ctx context.Context, conf config.Config, opts controller.ConstructOpts) (controller.Controller, error)
- func (t *Factory) ConstructConfig() config.Config
- func (t *Factory) GetConfigID() string
- func (t *Factory) GetControllerID() string
- func (t *Factory) GetVersion() controller.Version
- type RequestHandler
- type SRPCSaucerDebugServiceClient
- type SRPCSaucerDebugServiceHandler
- func (SRPCSaucerDebugServiceHandler) GetMethodIDs() []string
- func (d *SRPCSaucerDebugServiceHandler) GetServiceID() string
- func (d *SRPCSaucerDebugServiceHandler) InvokeMethod(serviceID, methodID string, strm srpc.Stream) (bool, error)
- func (SRPCSaucerDebugServiceHandler) InvokeMethod_EvalJS(impl SRPCSaucerDebugServiceServer, strm srpc.Stream) error
- type SRPCSaucerDebugServiceServer
- type SRPCSaucerDebugService_EvalJSStream
- type Saucer
- type SaucerInit
- func (m *SaucerInit) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *SaucerInit) CloneVT() *SaucerInit
- func (this *SaucerInit) EqualMessageVT(thatMsg any) bool
- func (this *SaucerInit) EqualVT(that *SaucerInit) bool
- func (x *SaucerInit) GetAppName() string
- func (x *SaucerInit) GetBootstrapHtml() string
- func (x *SaucerInit) GetBootstrapHtmlPath() string
- func (x *SaucerInit) GetDevTools() bool
- func (x *SaucerInit) GetEntrypointJs() string
- func (x *SaucerInit) GetEntrypointJsPath() string
- func (x *SaucerInit) GetExternalLinks() ExternalLinks
- func (x *SaucerInit) GetWindowHeight() uint32
- func (x *SaucerInit) GetWindowTitle() string
- func (x *SaucerInit) GetWindowWidth() uint32
- func (x *SaucerInit) MarshalJSON() ([]byte, error)
- func (x *SaucerInit) MarshalProtoJSON(s *json.MarshalState)
- func (x *SaucerInit) MarshalProtoText() string
- func (m *SaucerInit) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *SaucerInit) MarshalToVT(dAtA []byte) (int, error)
- func (m *SaucerInit) MarshalVT() (dAtA []byte, err error)
- func (*SaucerInit) ProtoMessage()
- func (x *SaucerInit) Reset()
- func (m *SaucerInit) SizeVT() (n int)
- func (x *SaucerInit) String() string
- func (x *SaucerInit) UnmarshalJSON(b []byte) error
- func (x *SaucerInit) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *SaucerInit) UnmarshalVT(dAtA []byte) error
Constants ¶
const ConfigID = ControllerID
ConfigID is the string used to identify this config object.
const ControllerID = "bldr/web/plugin/saucer"
ControllerID is the saucer runtime controller ID.
const RuntimeID = "saucer"
RuntimeID is the runtime identifier.
const SRPCSaucerDebugServiceServiceID = "saucer.SaucerDebugService"
Variables ¶
var ( ExternalLinks_name = map[int32]string{ 0: "EXTERNAL_LINKS_OS_BROWSER", 1: "EXTERNAL_LINKS_DENY", } ExternalLinks_value = map[string]int32{ "EXTERNAL_LINKS_OS_BROWSER": 0, "EXTERNAL_LINKS_DENY": 1, } )
Enum value maps for ExternalLinks.
var MaxFrameSize uint32 = 10 * 1024 * 1024 // 10MB
MaxFrameSize is the maximum size of a length-prefixed frame.
var Version = controller.MustParseVersion("0.0.1")
Version is the API version.
Functions ¶
func NewSRPCSaucerDebugServiceHandler ¶
func NewSRPCSaucerDebugServiceHandler(impl SRPCSaucerDebugServiceServer, serviceID string) srpc.Handler
NewSRPCSaucerDebugServiceHandler constructs a new RPC handler. serviceID: if empty, uses default: saucer.SaucerDebugService
func SRPCRegisterSaucerDebugService ¶
func SRPCRegisterSaucerDebugService(mux srpc.Mux, impl SRPCSaucerDebugServiceServer) error
SRPCRegisterSaucerDebugService registers the implementation with the mux. Uses the default serviceID: saucer.SaucerDebugService
Types ¶
type Config ¶
type Config struct {
// SaucerPath is the path to the saucer binary.
SaucerPath string `protobuf:"bytes,1,opt,name=saucer_path,json=saucerPath,proto3" json:"saucerPath,omitempty"`
// WorkdirPath is the path to the working directory to use.
// If unset, defaults to the current working directory of the process.
WorkdirPath string `protobuf:"bytes,2,opt,name=workdir_path,json=workdirPath,proto3" json:"workdirPath,omitempty"`
// WebRuntimeId is the value to use for the runtime uuid.
// Used for the Unix pipe paths and for the BroadcastChannel ids.
// Should be unique against other running Saucer instances.
WebRuntimeId string `protobuf:"bytes,3,opt,name=web_runtime_id,json=webRuntimeId,proto3" json:"webRuntimeId,omitempty"`
// ExternalLinks configures how external links are handled.
ExternalLinks ExternalLinks `protobuf:"varint,4,opt,name=external_links,json=externalLinks,proto3" json:"externalLinks,omitempty"`
// SaucerFlags are additional flags to pass to the saucer binary.
SaucerFlags []string `protobuf:"bytes,5,rep,name=saucer_flags,json=saucerFlags,proto3" json:"saucerFlags,omitempty"`
// BootstrapHtml is the HTML content to load initially.
// This is the full HTML string with import map.
BootstrapHtml string `protobuf:"bytes,6,opt,name=bootstrap_html,json=bootstrapHtml,proto3" json:"bootstrapHtml,omitempty"`
// DevTools enables the developer tools in the webview.
DevTools bool `protobuf:"varint,7,opt,name=dev_tools,json=devTools,proto3" json:"devTools,omitempty"`
// EntrypointJs is the entrypoint JavaScript module.
// This is written to a file and served at /entrypoint.mjs.
EntrypointJs string `protobuf:"bytes,8,opt,name=entrypoint_js,json=entrypointJs,proto3" json:"entrypointJs,omitempty"`
// AppName is the application display name.
AppName string `protobuf:"bytes,9,opt,name=app_name,json=appName,proto3" json:"appName,omitempty"`
// WindowTitle overrides the window title (defaults to app_name).
WindowTitle string `protobuf:"bytes,10,opt,name=window_title,json=windowTitle,proto3" json:"windowTitle,omitempty"`
// WindowWidth is the default window width in pixels.
WindowWidth uint32 `protobuf:"varint,11,opt,name=window_width,json=windowWidth,proto3" json:"windowWidth,omitempty"`
// WindowHeight is the default window height in pixels.
WindowHeight uint32 `protobuf:"varint,12,opt,name=window_height,json=windowHeight,proto3" json:"windowHeight,omitempty"`
// contains filtered or unexported fields
}
Config is the configuration for the saucer runtime.
func (*Config) CloneMessageVT ¶
func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*Config) EqualMessageVT ¶
func (*Config) EqualsConfig ¶
EqualsConfig checks if the other config is equal.
func (*Config) GetAppName ¶
func (*Config) GetBootstrapHtml ¶
func (*Config) GetConfigID ¶
GetConfigID returns the unique string for this configuration type.
func (*Config) GetDevTools ¶
func (*Config) GetEntrypointJs ¶
func (*Config) GetExternalLinks ¶
func (x *Config) GetExternalLinks() ExternalLinks
func (*Config) GetSaucerFlags ¶
func (*Config) GetSaucerPath ¶
func (*Config) GetWebRuntimeId ¶
func (*Config) GetWindowHeight ¶
func (*Config) GetWindowTitle ¶
func (*Config) GetWindowWidth ¶
func (*Config) GetWorkdirPath ¶
func (*Config) MarshalJSON ¶
MarshalJSON marshals the Config to JSON.
func (*Config) MarshalProtoJSON ¶
func (x *Config) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the Config message to JSON.
func (*Config) MarshalProtoText ¶
func (*Config) MarshalToSizedBufferVT ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) UnmarshalJSON ¶
UnmarshalJSON unmarshals the Config from JSON.
func (*Config) UnmarshalProtoJSON ¶
func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the Config message from JSON.
func (*Config) UnmarshalVT ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is the saucer runtime controller. Communicates with the Saucer webview via IPC.
func NewController ¶
func NewController( le *logrus.Entry, b bus.Bus, saucerPath, workdirPath, runtimeUuid string, extraSaucerArgs []string, saucerInit *SaucerInit, ) (*Controller, error)
NewController constructs a new Saucer runtime controller. sessionUuid is used to make the unix pipe path unique.
func (*Controller) Execute ¶
func (r *Controller) Execute(ctx context.Context) error
Execute executes the runtime. Returns any errors, nil if Execute is not required.
func (*Controller) GetBus ¶
func (r *Controller) GetBus() bus.Bus
GetBus returns the root controller bus to use in this process.
func (*Controller) GetControllerInfo ¶
func (r *Controller) GetControllerInfo() *controller.Info
GetControllerInfo returns information about the controller.
func (*Controller) GetLogger ¶
func (r *Controller) GetLogger() *logrus.Entry
GetLogger returns the root log entry.
func (*Controller) HandleDirective ¶
func (r *Controller) HandleDirective(ctx context.Context, di directive.Instance) ([]directive.Resolver, error)
HandleDirective asks if the handler can resolve the directive.
func (*Controller) WaitSaucer ¶
WaitSaucer waits for the Saucer object to be ready and returns it. if errCh is set, checks it for errors to return early.
type DocumentManager ¶
type DocumentManager struct {
// contains filtered or unexported fields
}
DocumentManager tracks connected web documents and manages RPC streams via yamux multiplexed over a single HTTP streaming connection per document.
func NewDocumentManager ¶
func NewDocumentManager(le *logrus.Entry) *DocumentManager
NewDocumentManager constructs a new DocumentManager.
func (*DocumentManager) CreateWebDocument ¶
func (dm *DocumentManager) CreateWebDocument(_ context.Context, _ *web_runtime.CreateWebDocumentRequest) (*web_runtime.CreateWebDocumentResponse, error)
CreateWebDocument is not supported for saucer (single window).
func (*DocumentManager) FlushIndexCache ¶ added in v0.51.3
func (dm *DocumentManager) FlushIndexCache(_ context.Context, _ *web_runtime.FlushIndexCacheRequest) (*web_runtime.FlushIndexCacheResponse, error)
FlushIndexCache is not supported for saucer.
func (*DocumentManager) GetDefaultDocID ¶
func (dm *DocumentManager) GetDefaultDocID() string
GetDefaultDocID returns the default document ID.
func (*DocumentManager) GetDocumentIDs ¶
func (dm *DocumentManager) GetDocumentIDs() []string
GetDocumentIDs returns the IDs of connected documents.
func (*DocumentManager) GetWebDocuments ¶
func (dm *DocumentManager) GetWebDocuments() map[string]*documentState
GetWebDocuments returns the current snapshot of active WebDocuments.
func (*DocumentManager) GetWebRuntimeStatusCtr ¶
func (dm *DocumentManager) GetWebRuntimeStatusCtr() *ccontainer.CContainer[*web_runtime.WebRuntimeStatus]
GetWebRuntimeStatusCtr returns the status container.
func (*DocumentManager) HandleWebDocumentRpc ¶
func (dm *DocumentManager) HandleWebDocumentRpc( ctx context.Context, componentID string, _ func(), ) (srpc.Invoker, func(), error)
HandleWebDocumentRpc handles a Go->JS RPC stream via the document manager.
func (*DocumentManager) RemoveWebDocument ¶
func (dm *DocumentManager) RemoveWebDocument(_ context.Context, _ *web_runtime.RemoveWebDocumentRequest) (*web_runtime.RemoveWebDocumentResponse, error)
RemoveWebDocument is not supported for saucer.
func (*DocumentManager) ServeSaucerHTTP ¶
func (dm *DocumentManager) ServeSaucerHTTP(rw http.ResponseWriter, req *http.Request)
ServeSaucerHTTP handles /b/saucer/* routes.
func (*DocumentManager) SetServer ¶
func (dm *DocumentManager) SetServer(srv *srpc.Server)
SetServer sets the SRPC server for handling JS-initiated RPC streams.
func (*DocumentManager) WaitDefaultDoc ¶
func (dm *DocumentManager) WaitDefaultDoc(ctx context.Context) (string, error)
WaitDefaultDoc waits for a default document to be set.
func (*DocumentManager) WatchWebRuntimeStatus ¶
func (dm *DocumentManager) WatchWebRuntimeStatus(_ *web_runtime.WatchWebRuntimeStatusRequest, strm web_runtime.SRPCWebRuntime_WatchWebRuntimeStatusStream) error
WatchWebRuntimeStatus streams document status updates to the Remote.
func (*DocumentManager) WebDocumentOpenStream ¶
func (dm *DocumentManager) WebDocumentOpenStream( ctx context.Context, msgHandler srpc.PacketDataHandler, closeHandler srpc.CloseHandler, webDocumentID string, ) (srpc.PacketWriter, error)
WebDocumentOpenStream opens an RPC stream with the given WebDocument via yamux.
func (*DocumentManager) WebDocumentRpc ¶
func (dm *DocumentManager) WebDocumentRpc(strm web_runtime.SRPCWebRuntime_WebDocumentRpcStream) error
WebDocumentRpc handles a Go->JS RPC stream via the SRPC protocol.
func (*DocumentManager) WebWorkerRpc ¶
func (dm *DocumentManager) WebWorkerRpc(_ web_runtime.SRPCWebRuntime_WebWorkerRpcStream) error
WebWorkerRpc is not supported for saucer.
type EvalJSRequest ¶
type EvalJSRequest struct {
// Code is the JavaScript code to evaluate.
Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
// contains filtered or unexported fields
}
EvalJSRequest is a request to evaluate JavaScript code.
func (*EvalJSRequest) CloneMessageVT ¶
func (m *EvalJSRequest) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*EvalJSRequest) CloneVT ¶
func (m *EvalJSRequest) CloneVT() *EvalJSRequest
func (*EvalJSRequest) EqualMessageVT ¶
func (this *EvalJSRequest) EqualMessageVT(thatMsg any) bool
func (*EvalJSRequest) EqualVT ¶
func (this *EvalJSRequest) EqualVT(that *EvalJSRequest) bool
func (*EvalJSRequest) GetCode ¶
func (x *EvalJSRequest) GetCode() string
func (*EvalJSRequest) MarshalJSON ¶
func (x *EvalJSRequest) MarshalJSON() ([]byte, error)
MarshalJSON marshals the EvalJSRequest to JSON.
func (*EvalJSRequest) MarshalProtoJSON ¶
func (x *EvalJSRequest) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the EvalJSRequest message to JSON.
func (*EvalJSRequest) MarshalProtoText ¶
func (x *EvalJSRequest) MarshalProtoText() string
func (*EvalJSRequest) MarshalToSizedBufferVT ¶
func (m *EvalJSRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*EvalJSRequest) MarshalToVT ¶
func (m *EvalJSRequest) MarshalToVT(dAtA []byte) (int, error)
func (*EvalJSRequest) MarshalVT ¶
func (m *EvalJSRequest) MarshalVT() (dAtA []byte, err error)
func (*EvalJSRequest) ProtoMessage ¶
func (*EvalJSRequest) ProtoMessage()
func (*EvalJSRequest) Reset ¶
func (x *EvalJSRequest) Reset()
func (*EvalJSRequest) SizeVT ¶
func (m *EvalJSRequest) SizeVT() (n int)
func (*EvalJSRequest) String ¶
func (x *EvalJSRequest) String() string
func (*EvalJSRequest) UnmarshalJSON ¶
func (x *EvalJSRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the EvalJSRequest from JSON.
func (*EvalJSRequest) UnmarshalProtoJSON ¶
func (x *EvalJSRequest) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the EvalJSRequest message from JSON.
func (*EvalJSRequest) UnmarshalVT ¶
func (m *EvalJSRequest) UnmarshalVT(dAtA []byte) error
type EvalJSResponse ¶
type EvalJSResponse struct {
// Result is the result string.
Result string `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
// Error is the error message, if any.
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
// contains filtered or unexported fields
}
EvalJSResponse is the response from evaluating JavaScript code.
func (*EvalJSResponse) CloneMessageVT ¶
func (m *EvalJSResponse) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*EvalJSResponse) CloneVT ¶
func (m *EvalJSResponse) CloneVT() *EvalJSResponse
func (*EvalJSResponse) EqualMessageVT ¶
func (this *EvalJSResponse) EqualMessageVT(thatMsg any) bool
func (*EvalJSResponse) EqualVT ¶
func (this *EvalJSResponse) EqualVT(that *EvalJSResponse) bool
func (*EvalJSResponse) GetError ¶
func (x *EvalJSResponse) GetError() string
func (*EvalJSResponse) GetResult ¶
func (x *EvalJSResponse) GetResult() string
func (*EvalJSResponse) MarshalJSON ¶
func (x *EvalJSResponse) MarshalJSON() ([]byte, error)
MarshalJSON marshals the EvalJSResponse to JSON.
func (*EvalJSResponse) MarshalProtoJSON ¶
func (x *EvalJSResponse) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the EvalJSResponse message to JSON.
func (*EvalJSResponse) MarshalProtoText ¶
func (x *EvalJSResponse) MarshalProtoText() string
func (*EvalJSResponse) MarshalToSizedBufferVT ¶
func (m *EvalJSResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*EvalJSResponse) MarshalToVT ¶
func (m *EvalJSResponse) MarshalToVT(dAtA []byte) (int, error)
func (*EvalJSResponse) MarshalVT ¶
func (m *EvalJSResponse) MarshalVT() (dAtA []byte, err error)
func (*EvalJSResponse) ProtoMessage ¶
func (*EvalJSResponse) ProtoMessage()
func (*EvalJSResponse) Reset ¶
func (x *EvalJSResponse) Reset()
func (*EvalJSResponse) SizeVT ¶
func (m *EvalJSResponse) SizeVT() (n int)
func (*EvalJSResponse) String ¶
func (x *EvalJSResponse) String() string
func (*EvalJSResponse) UnmarshalJSON ¶
func (x *EvalJSResponse) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the EvalJSResponse from JSON.
func (*EvalJSResponse) UnmarshalProtoJSON ¶
func (x *EvalJSResponse) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the EvalJSResponse message from JSON.
func (*EvalJSResponse) UnmarshalVT ¶
func (m *EvalJSResponse) UnmarshalVT(dAtA []byte) error
type ExternalLinks ¶
type ExternalLinks int32
ExternalLinks configures how external links are handled.
const ( // EXTERNAL_LINKS_OS_BROWSER opens external links in the OS default browser. ExternalLinks_EXTERNAL_LINKS_OS_BROWSER ExternalLinks = 0 // EXTERNAL_LINKS_DENY denies all external link navigation. ExternalLinks_EXTERNAL_LINKS_DENY ExternalLinks = 1 )
func (ExternalLinks) Enum ¶
func (x ExternalLinks) Enum() *ExternalLinks
func (ExternalLinks) MarshalJSON ¶
func (x ExternalLinks) MarshalJSON() ([]byte, error)
MarshalJSON marshals the ExternalLinks to JSON.
func (ExternalLinks) MarshalProtoJSON ¶
func (x ExternalLinks) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the ExternalLinks to JSON.
func (ExternalLinks) MarshalProtoText ¶
func (x ExternalLinks) MarshalProtoText() string
func (ExternalLinks) MarshalText ¶
func (x ExternalLinks) MarshalText() ([]byte, error)
MarshalText marshals the ExternalLinks to text.
func (ExternalLinks) String ¶
func (x ExternalLinks) String() string
func (*ExternalLinks) UnmarshalJSON ¶
func (x *ExternalLinks) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the ExternalLinks from JSON.
func (*ExternalLinks) UnmarshalProtoJSON ¶
func (x *ExternalLinks) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the ExternalLinks from JSON.
func (*ExternalLinks) UnmarshalText ¶
func (x *ExternalLinks) UnmarshalText(b []byte) error
UnmarshalText unmarshals the ExternalLinks from text.
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory constructs a Saucer runtime controller.
func (*Factory) Construct ¶
func (t *Factory) Construct( ctx context.Context, conf config.Config, opts controller.ConstructOpts, ) (controller.Controller, error)
Construct constructs the associated controller given configuration.
func (*Factory) ConstructConfig ¶
ConstructConfig constructs an instance of the controller configuration.
func (*Factory) GetConfigID ¶
GetConfigID returns the configuration ID for the controller.
func (*Factory) GetControllerID ¶
GetControllerID returns the unique ID for the controller.
func (*Factory) GetVersion ¶
func (t *Factory) GetVersion() controller.Version
GetVersion returns the version of this controller.
type RequestHandler ¶
type RequestHandler struct {
// contains filtered or unexported fields
}
RequestHandler accepts yamux streams from C++ and routes FetchRequest/FetchResponse.
func NewRequestHandler ¶
func NewRequestHandler( le *logrus.Entry, docMgr *DocumentManager, handler http.HandlerFunc, bootstrapHTML string, entrypointJS string, ) *RequestHandler
NewRequestHandler constructs a new RequestHandler.
func (*RequestHandler) AcceptStreams ¶
AcceptStreams accepts yamux streams from the muxed connection and handles each.
type SRPCSaucerDebugServiceClient ¶
type SRPCSaucerDebugServiceClient interface {
// SRPCClient returns the underlying SRPC client.
SRPCClient() srpc.Client
// EvalJS evaluates JavaScript code in the webview context.
EvalJS(ctx context.Context, in *EvalJSRequest) (*EvalJSResponse, error)
}
func NewSRPCSaucerDebugServiceClient ¶
func NewSRPCSaucerDebugServiceClient(cc srpc.Client) SRPCSaucerDebugServiceClient
func NewSRPCSaucerDebugServiceClientWithServiceID ¶
func NewSRPCSaucerDebugServiceClientWithServiceID(cc srpc.Client, serviceID string) SRPCSaucerDebugServiceClient
type SRPCSaucerDebugServiceHandler ¶
type SRPCSaucerDebugServiceHandler struct {
// contains filtered or unexported fields
}
func (SRPCSaucerDebugServiceHandler) GetMethodIDs ¶
func (SRPCSaucerDebugServiceHandler) GetMethodIDs() []string
func (*SRPCSaucerDebugServiceHandler) GetServiceID ¶
func (d *SRPCSaucerDebugServiceHandler) GetServiceID() string
func (*SRPCSaucerDebugServiceHandler) InvokeMethod ¶
func (SRPCSaucerDebugServiceHandler) InvokeMethod_EvalJS ¶
func (SRPCSaucerDebugServiceHandler) InvokeMethod_EvalJS(impl SRPCSaucerDebugServiceServer, strm srpc.Stream) error
type SRPCSaucerDebugServiceServer ¶
type SRPCSaucerDebugServiceServer interface {
// EvalJS evaluates JavaScript code in the webview context.
EvalJS(context.Context, *EvalJSRequest) (*EvalJSResponse, error)
}
type Saucer ¶
type Saucer struct {
// contains filtered or unexported fields
}
Saucer is a running instance of the Saucer webview.
func RunSaucer ¶
func RunSaucer( ctx context.Context, le *logrus.Entry, saucerPath, workdirPath, runtimeUuid string, extraSaucerFlags []string, saucerInit *SaucerInit, ) (*Saucer, error)
RunSaucer listens on the IPC pipe and starts the Saucer sub-process.
func (*Saucer) GetMuxedConn ¶
GetMuxedConn returns the main muxed conn with the C++ process.
type SaucerInit ¶
type SaucerInit struct {
// DevTools enables the developer tools.
DevTools bool `protobuf:"varint,1,opt,name=dev_tools,json=devTools,proto3" json:"devTools,omitempty"`
// BootstrapHtml is the HTML content to load initially.
// This is the full HTML string, not base64 encoded.
// Deprecated: Use bootstrap_html_path instead to avoid env var size limits.
BootstrapHtml string `protobuf:"bytes,2,opt,name=bootstrap_html,json=bootstrapHtml,proto3" json:"bootstrapHtml,omitempty"`
// ExternalLinks configures how external links are handled.
ExternalLinks ExternalLinks `protobuf:"varint,3,opt,name=external_links,json=externalLinks,proto3" json:"externalLinks,omitempty"`
// BootstrapHtmlPath is the path to a file containing the bootstrap HTML.
// Used instead of bootstrap_html to avoid "argument list too long" errors.
BootstrapHtmlPath string `protobuf:"bytes,4,opt,name=bootstrap_html_path,json=bootstrapHtmlPath,proto3" json:"bootstrapHtmlPath,omitempty"`
// EntrypointJs is the entrypoint JavaScript module content.
// Written to a file and passed as entrypoint_js_path to C++.
EntrypointJs string `protobuf:"bytes,5,opt,name=entrypoint_js,json=entrypointJs,proto3" json:"entrypointJs,omitempty"`
// EntrypointJsPath is the path to the entrypoint JS module file.
// The C++ binary serves this at /entrypoint.mjs.
EntrypointJsPath string `protobuf:"bytes,6,opt,name=entrypoint_js_path,json=entrypointJsPath,proto3" json:"entrypointJsPath,omitempty"`
// AppName is the application display name.
AppName string `protobuf:"bytes,7,opt,name=app_name,json=appName,proto3" json:"appName,omitempty"`
// WindowTitle overrides the window title (defaults to app_name).
WindowTitle string `protobuf:"bytes,8,opt,name=window_title,json=windowTitle,proto3" json:"windowTitle,omitempty"`
// WindowWidth is the default window width in pixels.
WindowWidth uint32 `protobuf:"varint,9,opt,name=window_width,json=windowWidth,proto3" json:"windowWidth,omitempty"`
// WindowHeight is the default window height in pixels.
WindowHeight uint32 `protobuf:"varint,10,opt,name=window_height,json=windowHeight,proto3" json:"windowHeight,omitempty"`
// contains filtered or unexported fields
}
SaucerInit is passed from Go to the Saucer C++ process on startup. Serialized as JSON and passed via BLDR_SAUCER_INIT env var.
func (*SaucerInit) CloneMessageVT ¶
func (m *SaucerInit) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*SaucerInit) CloneVT ¶
func (m *SaucerInit) CloneVT() *SaucerInit
func (*SaucerInit) EqualMessageVT ¶
func (this *SaucerInit) EqualMessageVT(thatMsg any) bool
func (*SaucerInit) EqualVT ¶
func (this *SaucerInit) EqualVT(that *SaucerInit) bool
func (*SaucerInit) GetAppName ¶
func (x *SaucerInit) GetAppName() string
func (*SaucerInit) GetBootstrapHtml ¶
func (x *SaucerInit) GetBootstrapHtml() string
func (*SaucerInit) GetBootstrapHtmlPath ¶
func (x *SaucerInit) GetBootstrapHtmlPath() string
func (*SaucerInit) GetDevTools ¶
func (x *SaucerInit) GetDevTools() bool
func (*SaucerInit) GetEntrypointJs ¶
func (x *SaucerInit) GetEntrypointJs() string
func (*SaucerInit) GetEntrypointJsPath ¶
func (x *SaucerInit) GetEntrypointJsPath() string
func (*SaucerInit) GetExternalLinks ¶
func (x *SaucerInit) GetExternalLinks() ExternalLinks
func (*SaucerInit) GetWindowHeight ¶
func (x *SaucerInit) GetWindowHeight() uint32
func (*SaucerInit) GetWindowTitle ¶
func (x *SaucerInit) GetWindowTitle() string
func (*SaucerInit) GetWindowWidth ¶
func (x *SaucerInit) GetWindowWidth() uint32
func (*SaucerInit) MarshalJSON ¶
func (x *SaucerInit) MarshalJSON() ([]byte, error)
MarshalJSON marshals the SaucerInit to JSON.
func (*SaucerInit) MarshalProtoJSON ¶
func (x *SaucerInit) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the SaucerInit message to JSON.
func (*SaucerInit) MarshalProtoText ¶
func (x *SaucerInit) MarshalProtoText() string
func (*SaucerInit) MarshalToSizedBufferVT ¶
func (m *SaucerInit) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*SaucerInit) MarshalToVT ¶
func (m *SaucerInit) MarshalToVT(dAtA []byte) (int, error)
func (*SaucerInit) MarshalVT ¶
func (m *SaucerInit) MarshalVT() (dAtA []byte, err error)
func (*SaucerInit) ProtoMessage ¶
func (*SaucerInit) ProtoMessage()
func (*SaucerInit) Reset ¶
func (x *SaucerInit) Reset()
func (*SaucerInit) SizeVT ¶
func (m *SaucerInit) SizeVT() (n int)
func (*SaucerInit) String ¶
func (x *SaucerInit) String() string
func (*SaucerInit) UnmarshalJSON ¶
func (x *SaucerInit) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the SaucerInit from JSON.
func (*SaucerInit) UnmarshalProtoJSON ¶
func (x *SaucerInit) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the SaucerInit message from JSON.
func (*SaucerInit) UnmarshalVT ¶
func (m *SaucerInit) UnmarshalVT(dAtA []byte) error