web_document

package
v0.51.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const SRPCWebDocumentHostServiceID = "web.document.WebDocumentHost"
View Source
const SRPCWebDocumentServiceID = "web.document.WebDocument"

Variables

View Source
var (
	WebWorkerType_name = map[int32]string{
		0: "WEB_WORKER_TYPE_NATIVE",
		1: "WEB_WORKER_TYPE_QUICKJS",
	}
	WebWorkerType_value = map[string]int32{
		"WEB_WORKER_TYPE_NATIVE":  0,
		"WEB_WORKER_TYPE_QUICKJS": 1,
	}
)

Enum value maps for WebWorkerType.

View Source
var (
	WebWorkerMode_name = map[int32]string{
		0: "WORKER_MODE_DEFAULT",
		1: "WORKER_MODE_SHARED",
		2: "WORKER_MODE_DEDICATED",
	}
	WebWorkerMode_value = map[string]int32{
		"WORKER_MODE_DEFAULT":   0,
		"WORKER_MODE_SHARED":    1,
		"WORKER_MODE_DEDICATED": 2,
	}
)

Enum value maps for WebWorkerMode.

View Source
var ErrEmptyWebDocumentID = errors.New("empty web document id")

ErrEmptyWebDocumentID is returned if the web view id was empty.

View Source
var RemoteVersion = semver.MustParse("0.0.1")

RemoteVersion is the Version of the web_document.Remote implementation.

Functions

func NewSRPCWebDocumentHandler

func NewSRPCWebDocumentHandler(impl SRPCWebDocumentServer, serviceID string) srpc.Handler

NewSRPCWebDocumentHandler constructs a new RPC handler. serviceID: if empty, uses default: web.document.WebDocument

func NewSRPCWebDocumentHostHandler

func NewSRPCWebDocumentHostHandler(impl SRPCWebDocumentHostServer, serviceID string) srpc.Handler

NewSRPCWebDocumentHostHandler constructs a new RPC handler. serviceID: if empty, uses default: web.document.WebDocumentHost

func SRPCRegisterWebDocument

func SRPCRegisterWebDocument(mux srpc.Mux, impl SRPCWebDocumentServer) error

SRPCRegisterWebDocument registers the implementation with the mux. Uses the default serviceID: web.document.WebDocument

func SRPCRegisterWebDocumentHost

func SRPCRegisterWebDocumentHost(mux srpc.Mux, impl SRPCWebDocumentHostServer) error

SRPCRegisterWebDocumentHost registers the implementation with the mux. Uses the default serviceID: web.document.WebDocumentHost

func ValidateWebDocumentId

func ValidateWebDocumentId(id string) error

ValidateWebDocumentId validates a document identifier.

Types

type CreateWebViewRequest

type CreateWebViewRequest struct {

	// id is the identifier for the new WebView.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

CreateWebViewRequest is a request to create a new web view.

func (*CreateWebViewRequest) CloneMessageVT

func (*CreateWebViewRequest) CloneVT

func (*CreateWebViewRequest) EqualMessageVT

func (this *CreateWebViewRequest) EqualMessageVT(thatMsg any) bool

func (*CreateWebViewRequest) EqualVT

func (this *CreateWebViewRequest) EqualVT(that *CreateWebViewRequest) bool

func (*CreateWebViewRequest) GetId

func (x *CreateWebViewRequest) GetId() string

func (*CreateWebViewRequest) MarshalJSON

func (x *CreateWebViewRequest) MarshalJSON() ([]byte, error)

MarshalJSON marshals the CreateWebViewRequest to JSON.

func (*CreateWebViewRequest) MarshalProtoJSON

func (x *CreateWebViewRequest) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the CreateWebViewRequest message to JSON.

func (*CreateWebViewRequest) MarshalProtoText

func (x *CreateWebViewRequest) MarshalProtoText() string

func (*CreateWebViewRequest) MarshalToSizedBufferVT

func (m *CreateWebViewRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*CreateWebViewRequest) MarshalToVT

func (m *CreateWebViewRequest) MarshalToVT(dAtA []byte) (int, error)

func (*CreateWebViewRequest) MarshalVT

func (m *CreateWebViewRequest) MarshalVT() (dAtA []byte, err error)

func (*CreateWebViewRequest) ProtoMessage

func (*CreateWebViewRequest) ProtoMessage()

func (*CreateWebViewRequest) Reset

func (x *CreateWebViewRequest) Reset()

func (*CreateWebViewRequest) SizeVT

func (m *CreateWebViewRequest) SizeVT() (n int)

func (*CreateWebViewRequest) String

func (x *CreateWebViewRequest) String() string

func (*CreateWebViewRequest) UnmarshalJSON

func (x *CreateWebViewRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the CreateWebViewRequest from JSON.

func (*CreateWebViewRequest) UnmarshalProtoJSON

func (x *CreateWebViewRequest) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the CreateWebViewRequest message from JSON.

func (*CreateWebViewRequest) UnmarshalVT

func (m *CreateWebViewRequest) UnmarshalVT(dAtA []byte) error

type CreateWebViewResponse

type CreateWebViewResponse struct {

	// Created indicates the web view was created.
	// If this is not set, assumes we cannot create WebViews.
	Created bool `protobuf:"varint,1,opt,name=created,proto3" json:"created,omitempty"`
	// contains filtered or unexported fields
}

CreateWebViewResponse is the response to the CreateWebView request.

func (*CreateWebViewResponse) CloneMessageVT

func (*CreateWebViewResponse) CloneVT

func (*CreateWebViewResponse) EqualMessageVT

func (this *CreateWebViewResponse) EqualMessageVT(thatMsg any) bool

func (*CreateWebViewResponse) EqualVT

func (this *CreateWebViewResponse) EqualVT(that *CreateWebViewResponse) bool

func (*CreateWebViewResponse) GetCreated

func (x *CreateWebViewResponse) GetCreated() bool

func (*CreateWebViewResponse) MarshalJSON

func (x *CreateWebViewResponse) MarshalJSON() ([]byte, error)

MarshalJSON marshals the CreateWebViewResponse to JSON.

func (*CreateWebViewResponse) MarshalProtoJSON

func (x *CreateWebViewResponse) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the CreateWebViewResponse message to JSON.

func (*CreateWebViewResponse) MarshalProtoText

func (x *CreateWebViewResponse) MarshalProtoText() string

func (*CreateWebViewResponse) MarshalToSizedBufferVT

func (m *CreateWebViewResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*CreateWebViewResponse) MarshalToVT

func (m *CreateWebViewResponse) MarshalToVT(dAtA []byte) (int, error)

func (*CreateWebViewResponse) MarshalVT

func (m *CreateWebViewResponse) MarshalVT() (dAtA []byte, err error)

func (*CreateWebViewResponse) ProtoMessage

func (*CreateWebViewResponse) ProtoMessage()

func (*CreateWebViewResponse) Reset

func (x *CreateWebViewResponse) Reset()

func (*CreateWebViewResponse) SizeVT

func (m *CreateWebViewResponse) SizeVT() (n int)

func (*CreateWebViewResponse) String

func (x *CreateWebViewResponse) String() string

func (*CreateWebViewResponse) UnmarshalJSON

func (x *CreateWebViewResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the CreateWebViewResponse from JSON.

func (*CreateWebViewResponse) UnmarshalProtoJSON

func (x *CreateWebViewResponse) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the CreateWebViewResponse message from JSON.

func (*CreateWebViewResponse) UnmarshalVT

func (m *CreateWebViewResponse) UnmarshalVT(dAtA []byte) error

type CreateWebWorkerRequest

type CreateWebWorkerRequest struct {

	// Id is the identifier for the new WebWorker.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Path is the path to the source to load into the worker.
	// This is passed to the shared-worker.ts loader.
	// Used as the path after the current host. For example /path/to/script.mjs
	Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	// WorkerMode controls whether the worker should be shared or dedicated.
	// If unset, defaults to WORKER_MODE_DEFAULT.
	WorkerMode WebWorkerMode `protobuf:"varint,3,opt,name=worker_mode,json=workerMode,proto3" json:"workerMode,omitempty"`
	// InitData is initialization data to pass to the worker.
	//
	// Usually a WebWorkerWasmPluginInit.
	InitData []byte `protobuf:"bytes,4,opt,name=init_data,json=initData,proto3" json:"initData,omitempty"`
	// WorkerType specifies which SharedWorker harness to use.
	// If unset, defaults to WEB_WORKER_TYPE_NATIVE.
	WorkerType WebWorkerType `protobuf:"varint,5,opt,name=worker_type,json=workerType,proto3" json:"workerType,omitempty"`
	// contains filtered or unexported fields
}

CreateWebWorkerRequest is a request to create a new web worker.

func (*CreateWebWorkerRequest) CloneMessageVT

func (*CreateWebWorkerRequest) CloneVT

func (*CreateWebWorkerRequest) EqualMessageVT

func (this *CreateWebWorkerRequest) EqualMessageVT(thatMsg any) bool

func (*CreateWebWorkerRequest) EqualVT

func (this *CreateWebWorkerRequest) EqualVT(that *CreateWebWorkerRequest) bool

func (*CreateWebWorkerRequest) GetId

func (x *CreateWebWorkerRequest) GetId() string

func (*CreateWebWorkerRequest) GetInitData

func (x *CreateWebWorkerRequest) GetInitData() []byte

func (*CreateWebWorkerRequest) GetPath

func (x *CreateWebWorkerRequest) GetPath() string

func (*CreateWebWorkerRequest) GetWorkerMode

func (x *CreateWebWorkerRequest) GetWorkerMode() WebWorkerMode

func (*CreateWebWorkerRequest) GetWorkerType

func (x *CreateWebWorkerRequest) GetWorkerType() WebWorkerType

func (*CreateWebWorkerRequest) MarshalJSON

func (x *CreateWebWorkerRequest) MarshalJSON() ([]byte, error)

MarshalJSON marshals the CreateWebWorkerRequest to JSON.

func (*CreateWebWorkerRequest) MarshalProtoJSON

func (x *CreateWebWorkerRequest) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the CreateWebWorkerRequest message to JSON.

func (*CreateWebWorkerRequest) MarshalProtoText

func (x *CreateWebWorkerRequest) MarshalProtoText() string

func (*CreateWebWorkerRequest) MarshalToSizedBufferVT

func (m *CreateWebWorkerRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*CreateWebWorkerRequest) MarshalToVT

func (m *CreateWebWorkerRequest) MarshalToVT(dAtA []byte) (int, error)

func (*CreateWebWorkerRequest) MarshalVT

func (m *CreateWebWorkerRequest) MarshalVT() (dAtA []byte, err error)

func (*CreateWebWorkerRequest) ProtoMessage

func (*CreateWebWorkerRequest) ProtoMessage()

func (*CreateWebWorkerRequest) Reset

func (x *CreateWebWorkerRequest) Reset()

func (*CreateWebWorkerRequest) SizeVT

func (m *CreateWebWorkerRequest) SizeVT() (n int)

func (*CreateWebWorkerRequest) String

func (x *CreateWebWorkerRequest) String() string

func (*CreateWebWorkerRequest) UnmarshalJSON

func (x *CreateWebWorkerRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the CreateWebWorkerRequest from JSON.

func (*CreateWebWorkerRequest) UnmarshalProtoJSON

func (x *CreateWebWorkerRequest) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the CreateWebWorkerRequest message from JSON.

func (*CreateWebWorkerRequest) UnmarshalVT

func (m *CreateWebWorkerRequest) UnmarshalVT(dAtA []byte) error

func (*CreateWebWorkerRequest) Validate

func (r *CreateWebWorkerRequest) Validate() error

Validate validates the request.

type CreateWebWorkerResponse

type CreateWebWorkerResponse struct {

	// Created indicates the WebWorker was created.
	// If this is not set, assumes we cannot create WebWorkers.
	Created bool `protobuf:"varint,1,opt,name=created,proto3" json:"created,omitempty"`
	// Shared indicates that SharedWorker was supported & used
	// Should only be set if shared was also set in the request
	Shared bool `protobuf:"varint,2,opt,name=shared,proto3" json:"shared,omitempty"`
	// contains filtered or unexported fields
}

CreateWebWorkerResponse is the response to the CreateWebWorker request.

func (*CreateWebWorkerResponse) CloneMessageVT

func (*CreateWebWorkerResponse) CloneVT

func (*CreateWebWorkerResponse) EqualMessageVT

func (this *CreateWebWorkerResponse) EqualMessageVT(thatMsg any) bool

func (*CreateWebWorkerResponse) EqualVT

func (*CreateWebWorkerResponse) GetCreated

func (x *CreateWebWorkerResponse) GetCreated() bool

func (*CreateWebWorkerResponse) GetShared

func (x *CreateWebWorkerResponse) GetShared() bool

func (*CreateWebWorkerResponse) MarshalJSON

func (x *CreateWebWorkerResponse) MarshalJSON() ([]byte, error)

MarshalJSON marshals the CreateWebWorkerResponse to JSON.

func (*CreateWebWorkerResponse) MarshalProtoJSON

func (x *CreateWebWorkerResponse) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the CreateWebWorkerResponse message to JSON.

func (*CreateWebWorkerResponse) MarshalProtoText

func (x *CreateWebWorkerResponse) MarshalProtoText() string

func (*CreateWebWorkerResponse) MarshalToSizedBufferVT

func (m *CreateWebWorkerResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*CreateWebWorkerResponse) MarshalToVT

func (m *CreateWebWorkerResponse) MarshalToVT(dAtA []byte) (int, error)

func (*CreateWebWorkerResponse) MarshalVT

func (m *CreateWebWorkerResponse) MarshalVT() (dAtA []byte, err error)

func (*CreateWebWorkerResponse) ProtoMessage

func (*CreateWebWorkerResponse) ProtoMessage()

func (*CreateWebWorkerResponse) Reset

func (x *CreateWebWorkerResponse) Reset()

func (*CreateWebWorkerResponse) SizeVT

func (m *CreateWebWorkerResponse) SizeVT() (n int)

func (*CreateWebWorkerResponse) String

func (x *CreateWebWorkerResponse) String() string

func (*CreateWebWorkerResponse) UnmarshalJSON

func (x *CreateWebWorkerResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the CreateWebWorkerResponse from JSON.

func (*CreateWebWorkerResponse) UnmarshalProtoJSON

func (x *CreateWebWorkerResponse) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the CreateWebWorkerResponse message from JSON.

func (*CreateWebWorkerResponse) UnmarshalVT

func (m *CreateWebWorkerResponse) UnmarshalVT(dAtA []byte) error

type LookupWebDocument

type LookupWebDocument interface {
	// Directive indicates LookupWebDocument is a directive.
	directive.Directive

	// LookupWebDocumentID is the web view ID to lookup.
	// Cannot be empty.
	LookupWebDocumentID() string
	// LookupWebDocumentWait indicates we should wait for the view to exist.
	//
	// If unset, we expect the doc already exists, and will not be recreated
	// after it is deleted (thus pointless to wait if not found).
	LookupWebDocumentWait() bool
}

LookupWebDocument is a directive to lookup a WebDocument.

func NewLookupWebDocument

func NewLookupWebDocument(webViewID string, wait bool) LookupWebDocument

NewLookupWebDocument constructs a new LookupWebDocument directive.

type LookupWebDocumentValue

type LookupWebDocumentValue = WebDocument

LookupWebDocumentValue is the result of LookupWebDocument.

func ExLookupWebDocument

func ExLookupWebDocument(
	ctx context.Context,
	b bus.Bus,
	returnIfIdle bool,
	webViewID string,
	wait bool,
) (LookupWebDocumentValue, directive.Instance, directive.Reference, error)

ExLookupWebDocument looks up a web view by id.

wait waits for the web view to exist.

type Remote

type Remote struct {
	// contains filtered or unexported fields
}

Remote is a remote instance of a WebDocument.

Communicates with the frontend using bldr/web-document.ts

func NewRemote

func NewRemote(
	ctx context.Context,
	le *logrus.Entry,
	b bus.Bus,
	handler WebDocumentHandler,
	webDocumentId string,
	openStream srpc.OpenStreamFunc,
) (*Remote, error)

NewRemote constructs a new browser runtime.

id should be the runtime identifier specified at startup by the js loader. initWebView should be a handle to the WebView which created the Remote.

func (*Remote) CreateWebView

func (r *Remote) CreateWebView(ctx context.Context, webViewID string) (bool, error)

CreateWebView creates a new web view and waits for it to become active.

Returns false, nil if the document was hidden or view cannot be created.

func (*Remote) CreateWebWorker

func (r *Remote) CreateWebWorker(ctx context.Context, req *CreateWebWorkerRequest) (web_worker.WebWorker, error)

CreateWebWorker creates a new web worker.

Returns ErrWebWorkerUnavailable if WebWorker is not available or cannot be created. If shared is set, attempts to create a SharedWorker (but might not if not supported). Returns nil, nil if the worker was not created. If the worker already existed it will be deleted and recreated.

func (*Remote) Execute

func (r *Remote) Execute(rctx context.Context) error

Execute executes the runtime. Returns any errors, nil if Execute is not required.

func (*Remote) GetBus

func (r *Remote) GetBus() bus.Bus

GetBus returns the root controller bus to use in this process.

func (*Remote) GetLogger

func (r *Remote) GetLogger() *logrus.Entry

GetLogger returns the root log entry.

func (*Remote) GetMux

func (r *Remote) GetMux() srpc.Mux

GetMux returns the WebDocumentHost service mux.

func (*Remote) GetWebDocumentMux

func (r *Remote) GetWebDocumentMux(ctx context.Context, webDocumentId string) (srpc.Mux, error)

GetWebDocumentMux returns the Mux serving requests for the given WebDocument.

immediately returns a loopback reference to the root Mux.

func (*Remote) GetWebDocumentStatusCtr

func (r *Remote) GetWebDocumentStatusCtr() *ccontainer.CContainer[*WebDocumentStatus]

GetWebDocumentStatusCtr contains a full snapshot of the web document status.

func (*Remote) GetWebDocumentUuid

func (r *Remote) GetWebDocumentUuid() string

GetWebDocumentUuid returns the web document identifier.

func (*Remote) GetWebView

func (r *Remote) GetWebView(ctx context.Context, webViewID string, wait bool) (web_view.WebView, error)

GetWebView waits for the remote to be ready & returns the given WebView. If wait is set, waits for the web document ID to exist. Otherwise, returns nil, nil if not found.

func (*Remote) GetWebViewHost

func (r *Remote) GetWebViewHost(ctx context.Context, webViewId string, _ func()) (srpc.Invoker, func(), error)

GetWebViewHost returns the Invoker for serving incoming requests for the given WebView.

Waits for the given web view ID to be available, or ctx to be canceled.

func (*Remote) GetWebViewOpenStream

func (r *Remote) GetWebViewOpenStream(webViewId string) srpc.OpenStreamFunc

GetWebViewOpenStream returns a OpenStreamFunc for the given WebView ID.

note: when opening the stream, waits for the given web document to exist.

func (*Remote) GetWebViews

func (r *Remote) GetWebViews(ctx context.Context) (map[string]web_view.WebView, error)

GetWebViews returns the current snapshot of active WebViews.

func (*Remote) GetWebWorker

func (r *Remote) GetWebWorker(ctx context.Context, webWorkerID string, wait bool) (web_worker.WebWorker, error)

GetWebWorker waits for the worker to be started. Returns the WebWorker object or returns nil, nil if not found. If wait is set, waits for the web worker ID to exist. Otherwise, returns nil, nil if not found.

func (*Remote) GetWebWorkers

func (r *Remote) GetWebWorkers(ctx context.Context) (map[string]web_worker.WebWorker, error)

GetWebWorkers returns the current snapshot of active WebWorkers.

func (*Remote) WaitFirstWebView

func (r *Remote) WaitFirstWebView(ctx context.Context) (web_view.WebView, error)

WaitFirstWebView waits for at least one WebView to exist.

func (*Remote) WaitReady

func (r *Remote) WaitReady(ctx context.Context) error

WaitReady waits for the state to be ready.

func (*Remote) WebViewOpenStream

func (r *Remote) WebViewOpenStream(
	ctx context.Context,
	msgHandler srpc.PacketDataHandler,
	closeHandler srpc.CloseHandler,
	webViewID string,
) (srpc.PacketWriter, error)

WebViewOpenStream opens a stream with the given WebView ID.

note: when opening the stream, waits for the given web document to exist.

type RemoveWebWorkerRequest

type RemoveWebWorkerRequest struct {

	// Id is the identifier for the removed WebWorker.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

RemoveWebWorkerRequest is a request to terminate a web worker.

func (*RemoveWebWorkerRequest) CloneMessageVT

func (*RemoveWebWorkerRequest) CloneVT

func (*RemoveWebWorkerRequest) EqualMessageVT

func (this *RemoveWebWorkerRequest) EqualMessageVT(thatMsg any) bool

func (*RemoveWebWorkerRequest) EqualVT

func (this *RemoveWebWorkerRequest) EqualVT(that *RemoveWebWorkerRequest) bool

func (*RemoveWebWorkerRequest) GetId

func (x *RemoveWebWorkerRequest) GetId() string

func (*RemoveWebWorkerRequest) MarshalJSON

func (x *RemoveWebWorkerRequest) MarshalJSON() ([]byte, error)

MarshalJSON marshals the RemoveWebWorkerRequest to JSON.

func (*RemoveWebWorkerRequest) MarshalProtoJSON

func (x *RemoveWebWorkerRequest) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the RemoveWebWorkerRequest message to JSON.

func (*RemoveWebWorkerRequest) MarshalProtoText

func (x *RemoveWebWorkerRequest) MarshalProtoText() string

func (*RemoveWebWorkerRequest) MarshalToSizedBufferVT

func (m *RemoveWebWorkerRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*RemoveWebWorkerRequest) MarshalToVT

func (m *RemoveWebWorkerRequest) MarshalToVT(dAtA []byte) (int, error)

func (*RemoveWebWorkerRequest) MarshalVT

func (m *RemoveWebWorkerRequest) MarshalVT() (dAtA []byte, err error)

func (*RemoveWebWorkerRequest) ProtoMessage

func (*RemoveWebWorkerRequest) ProtoMessage()

func (*RemoveWebWorkerRequest) Reset

func (x *RemoveWebWorkerRequest) Reset()

func (*RemoveWebWorkerRequest) SizeVT

func (m *RemoveWebWorkerRequest) SizeVT() (n int)

func (*RemoveWebWorkerRequest) String

func (x *RemoveWebWorkerRequest) String() string

func (*RemoveWebWorkerRequest) UnmarshalJSON

func (x *RemoveWebWorkerRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the RemoveWebWorkerRequest from JSON.

func (*RemoveWebWorkerRequest) UnmarshalProtoJSON

func (x *RemoveWebWorkerRequest) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the RemoveWebWorkerRequest message from JSON.

func (*RemoveWebWorkerRequest) UnmarshalVT

func (m *RemoveWebWorkerRequest) UnmarshalVT(dAtA []byte) error

type RemoveWebWorkerResponse

type RemoveWebWorkerResponse struct {

	// Removed indicates the WebWorker was removed.
	// If false, the worker was not found or not running.
	Removed bool `protobuf:"varint,1,opt,name=removed,proto3" json:"removed,omitempty"`
	// contains filtered or unexported fields
}

RemoveWebWorkerResponse is the response to the RemoveWebWorker request.

func (*RemoveWebWorkerResponse) CloneMessageVT

func (*RemoveWebWorkerResponse) CloneVT

func (*RemoveWebWorkerResponse) EqualMessageVT

func (this *RemoveWebWorkerResponse) EqualMessageVT(thatMsg any) bool

func (*RemoveWebWorkerResponse) EqualVT

func (*RemoveWebWorkerResponse) GetRemoved

func (x *RemoveWebWorkerResponse) GetRemoved() bool

func (*RemoveWebWorkerResponse) MarshalJSON

func (x *RemoveWebWorkerResponse) MarshalJSON() ([]byte, error)

MarshalJSON marshals the RemoveWebWorkerResponse to JSON.

func (*RemoveWebWorkerResponse) MarshalProtoJSON

func (x *RemoveWebWorkerResponse) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the RemoveWebWorkerResponse message to JSON.

func (*RemoveWebWorkerResponse) MarshalProtoText

func (x *RemoveWebWorkerResponse) MarshalProtoText() string

func (*RemoveWebWorkerResponse) MarshalToSizedBufferVT

func (m *RemoveWebWorkerResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*RemoveWebWorkerResponse) MarshalToVT

func (m *RemoveWebWorkerResponse) MarshalToVT(dAtA []byte) (int, error)

func (*RemoveWebWorkerResponse) MarshalVT

func (m *RemoveWebWorkerResponse) MarshalVT() (dAtA []byte, err error)

func (*RemoveWebWorkerResponse) ProtoMessage

func (*RemoveWebWorkerResponse) ProtoMessage()

func (*RemoveWebWorkerResponse) Reset

func (x *RemoveWebWorkerResponse) Reset()

func (*RemoveWebWorkerResponse) SizeVT

func (m *RemoveWebWorkerResponse) SizeVT() (n int)

func (*RemoveWebWorkerResponse) String

func (x *RemoveWebWorkerResponse) String() string

func (*RemoveWebWorkerResponse) UnmarshalJSON

func (x *RemoveWebWorkerResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the RemoveWebWorkerResponse from JSON.

func (*RemoveWebWorkerResponse) UnmarshalProtoJSON

func (x *RemoveWebWorkerResponse) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the RemoveWebWorkerResponse message from JSON.

func (*RemoveWebWorkerResponse) UnmarshalVT

func (m *RemoveWebWorkerResponse) UnmarshalVT(dAtA []byte) error

type SRPCWebDocumentClient

type SRPCWebDocumentClient interface {
	// SRPCClient returns the underlying SRPC client.
	SRPCClient() srpc.Client

	// WatchWebDocumentStatus returns an initial snapshot of WebViews followed by updates.
	WatchWebDocumentStatus(ctx context.Context, in *WatchWebDocumentStatusRequest) (SRPCWebDocument_WatchWebDocumentStatusClient, error)
	// CreateWebView requests to create a new WebView at the root level.
	// Returns created: false if unable to create WebViews.
	CreateWebView(ctx context.Context, in *CreateWebViewRequest) (*CreateWebViewResponse, error)
	// WebViewRpc opens a stream for a RPC call to a WebView.
	// ID is the webViewId.
	WebViewRpc(ctx context.Context) (SRPCWebDocument_WebViewRpcClient, error)
	// CreateWebWorker requests to spawn a WebWorker with an instance identifier.
	// If a worker already exists with that ID, it will be terminated before starting the new.
	// Returns created: false if unable to create WebWorkers.
	// This usually creates a new SharedWorker.
	// The worker is expected to close itself if it becomes disconnected or broken.
	// The worker is passed a MessagePort that can be used to open WebRuntimeClient.
	CreateWebWorker(ctx context.Context, in *CreateWebWorkerRequest) (*CreateWebWorkerResponse, error)
	// RemoveWebWorker requests to terminate a WebWorker with the given id.
	RemoveWebWorker(ctx context.Context, in *RemoveWebWorkerRequest) (*RemoveWebWorkerResponse, error)
}

func NewSRPCWebDocumentClient

func NewSRPCWebDocumentClient(cc srpc.Client) SRPCWebDocumentClient

func NewSRPCWebDocumentClientWithServiceID

func NewSRPCWebDocumentClientWithServiceID(cc srpc.Client, serviceID string) SRPCWebDocumentClient

type SRPCWebDocumentHandler

type SRPCWebDocumentHandler struct {
	// contains filtered or unexported fields
}

func (SRPCWebDocumentHandler) GetMethodIDs

func (SRPCWebDocumentHandler) GetMethodIDs() []string

func (*SRPCWebDocumentHandler) GetServiceID

func (d *SRPCWebDocumentHandler) GetServiceID() string

func (*SRPCWebDocumentHandler) InvokeMethod

func (d *SRPCWebDocumentHandler) InvokeMethod(
	serviceID, methodID string,
	strm srpc.Stream,
) (bool, error)

func (SRPCWebDocumentHandler) InvokeMethod_CreateWebView

func (SRPCWebDocumentHandler) InvokeMethod_CreateWebView(impl SRPCWebDocumentServer, strm srpc.Stream) error

func (SRPCWebDocumentHandler) InvokeMethod_CreateWebWorker

func (SRPCWebDocumentHandler) InvokeMethod_CreateWebWorker(impl SRPCWebDocumentServer, strm srpc.Stream) error

func (SRPCWebDocumentHandler) InvokeMethod_RemoveWebWorker

func (SRPCWebDocumentHandler) InvokeMethod_RemoveWebWorker(impl SRPCWebDocumentServer, strm srpc.Stream) error

func (SRPCWebDocumentHandler) InvokeMethod_WatchWebDocumentStatus

func (SRPCWebDocumentHandler) InvokeMethod_WatchWebDocumentStatus(impl SRPCWebDocumentServer, strm srpc.Stream) error

func (SRPCWebDocumentHandler) InvokeMethod_WebViewRpc

func (SRPCWebDocumentHandler) InvokeMethod_WebViewRpc(impl SRPCWebDocumentServer, strm srpc.Stream) error

type SRPCWebDocumentHostClient

type SRPCWebDocumentHostClient interface {
	// SRPCClient returns the underlying SRPC client.
	SRPCClient() srpc.Client

	// WebViewRpc opens a stream for a RPC call from a WebView.
	// Exposes the WebViewHost service.
	// Id is the webViewId.
	WebViewRpc(ctx context.Context) (SRPCWebDocumentHost_WebViewRpcClient, error)
}

func NewSRPCWebDocumentHostClient

func NewSRPCWebDocumentHostClient(cc srpc.Client) SRPCWebDocumentHostClient

func NewSRPCWebDocumentHostClientWithServiceID

func NewSRPCWebDocumentHostClientWithServiceID(cc srpc.Client, serviceID string) SRPCWebDocumentHostClient

type SRPCWebDocumentHostHandler

type SRPCWebDocumentHostHandler struct {
	// contains filtered or unexported fields
}

func (SRPCWebDocumentHostHandler) GetMethodIDs

func (SRPCWebDocumentHostHandler) GetMethodIDs() []string

func (*SRPCWebDocumentHostHandler) GetServiceID

func (d *SRPCWebDocumentHostHandler) GetServiceID() string

func (*SRPCWebDocumentHostHandler) InvokeMethod

func (d *SRPCWebDocumentHostHandler) InvokeMethod(
	serviceID, methodID string,
	strm srpc.Stream,
) (bool, error)

func (SRPCWebDocumentHostHandler) InvokeMethod_WebViewRpc

func (SRPCWebDocumentHostHandler) InvokeMethod_WebViewRpc(impl SRPCWebDocumentHostServer, strm srpc.Stream) error

type SRPCWebDocumentHostServer

type SRPCWebDocumentHostServer interface {
	// WebViewRpc opens a stream for a RPC call from a WebView.
	// Exposes the WebViewHost service.
	// Id is the webViewId.
	WebViewRpc(SRPCWebDocumentHost_WebViewRpcStream) error
}

type SRPCWebDocumentHost_WebViewRpcClient

type SRPCWebDocumentHost_WebViewRpcClient interface {
	srpc.Stream
	Send(*rpcstream.RpcStreamPacket) error
	Recv() (*rpcstream.RpcStreamPacket, error)
	RecvTo(*rpcstream.RpcStreamPacket) error
}

type SRPCWebDocumentHost_WebViewRpcStream

type SRPCWebDocumentHost_WebViewRpcStream interface {
	srpc.Stream
	Send(*rpcstream.RpcStreamPacket) error
	SendAndClose(*rpcstream.RpcStreamPacket) error
	Recv() (*rpcstream.RpcStreamPacket, error)
	RecvTo(*rpcstream.RpcStreamPacket) error
}

type SRPCWebDocumentServer

type SRPCWebDocumentServer interface {
	// WatchWebDocumentStatus returns an initial snapshot of WebViews followed by updates.
	WatchWebDocumentStatus(*WatchWebDocumentStatusRequest, SRPCWebDocument_WatchWebDocumentStatusStream) error
	// CreateWebView requests to create a new WebView at the root level.
	// Returns created: false if unable to create WebViews.
	CreateWebView(context.Context, *CreateWebViewRequest) (*CreateWebViewResponse, error)
	// WebViewRpc opens a stream for a RPC call to a WebView.
	// ID is the webViewId.
	WebViewRpc(SRPCWebDocument_WebViewRpcStream) error
	// CreateWebWorker requests to spawn a WebWorker with an instance identifier.
	// If a worker already exists with that ID, it will be terminated before starting the new.
	// Returns created: false if unable to create WebWorkers.
	// This usually creates a new SharedWorker.
	// The worker is expected to close itself if it becomes disconnected or broken.
	// The worker is passed a MessagePort that can be used to open WebRuntimeClient.
	CreateWebWorker(context.Context, *CreateWebWorkerRequest) (*CreateWebWorkerResponse, error)
	// RemoveWebWorker requests to terminate a WebWorker with the given id.
	RemoveWebWorker(context.Context, *RemoveWebWorkerRequest) (*RemoveWebWorkerResponse, error)
}

type SRPCWebDocument_CreateWebViewStream

type SRPCWebDocument_CreateWebViewStream interface {
	srpc.Stream
}

type SRPCWebDocument_CreateWebWorkerStream

type SRPCWebDocument_CreateWebWorkerStream interface {
	srpc.Stream
}

type SRPCWebDocument_RemoveWebWorkerStream

type SRPCWebDocument_RemoveWebWorkerStream interface {
	srpc.Stream
}

type SRPCWebDocument_WatchWebDocumentStatusClient

type SRPCWebDocument_WatchWebDocumentStatusClient interface {
	srpc.Stream
	Recv() (*WebDocumentStatus, error)
	RecvTo(*WebDocumentStatus) error
}

type SRPCWebDocument_WatchWebDocumentStatusStream

type SRPCWebDocument_WatchWebDocumentStatusStream interface {
	srpc.Stream
	Send(*WebDocumentStatus) error
	SendAndClose(*WebDocumentStatus) error
}

type SRPCWebDocument_WebViewRpcClient

type SRPCWebDocument_WebViewRpcClient interface {
	srpc.Stream
	Send(*rpcstream.RpcStreamPacket) error
	Recv() (*rpcstream.RpcStreamPacket, error)
	RecvTo(*rpcstream.RpcStreamPacket) error
}

type SRPCWebDocument_WebViewRpcStream

type SRPCWebDocument_WebViewRpcStream interface {
	srpc.Stream
	Send(*rpcstream.RpcStreamPacket) error
	SendAndClose(*rpcstream.RpcStreamPacket) error
	Recv() (*rpcstream.RpcStreamPacket, error)
	RecvTo(*rpcstream.RpcStreamPacket) error
}

type WatchWebDocumentStatusRequest

type WatchWebDocumentStatusRequest struct {
	// contains filtered or unexported fields
}

WatchWebDocumentStatusRequest is the body of the WatchWebDocumentStatus request.

func NewWatchWebDocumentStatusRequest

func NewWatchWebDocumentStatusRequest() *WatchWebDocumentStatusRequest

NewWatchWebDocumentStatusRequest constructs a new message to watch for WebDocument status changes.

func (*WatchWebDocumentStatusRequest) CloneMessageVT

func (*WatchWebDocumentStatusRequest) CloneVT

func (*WatchWebDocumentStatusRequest) EqualMessageVT

func (this *WatchWebDocumentStatusRequest) EqualMessageVT(thatMsg any) bool

func (*WatchWebDocumentStatusRequest) EqualVT

func (*WatchWebDocumentStatusRequest) MarshalJSON

func (x *WatchWebDocumentStatusRequest) MarshalJSON() ([]byte, error)

MarshalJSON marshals the WatchWebDocumentStatusRequest to JSON.

func (*WatchWebDocumentStatusRequest) MarshalProtoJSON

func (x *WatchWebDocumentStatusRequest) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the WatchWebDocumentStatusRequest message to JSON.

func (*WatchWebDocumentStatusRequest) MarshalProtoText

func (x *WatchWebDocumentStatusRequest) MarshalProtoText() string

func (*WatchWebDocumentStatusRequest) MarshalToSizedBufferVT

func (m *WatchWebDocumentStatusRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*WatchWebDocumentStatusRequest) MarshalToVT

func (m *WatchWebDocumentStatusRequest) MarshalToVT(dAtA []byte) (int, error)

func (*WatchWebDocumentStatusRequest) MarshalVT

func (m *WatchWebDocumentStatusRequest) MarshalVT() (dAtA []byte, err error)

func (*WatchWebDocumentStatusRequest) ProtoMessage

func (*WatchWebDocumentStatusRequest) ProtoMessage()

func (*WatchWebDocumentStatusRequest) Reset

func (x *WatchWebDocumentStatusRequest) Reset()

func (*WatchWebDocumentStatusRequest) SizeVT

func (m *WatchWebDocumentStatusRequest) SizeVT() (n int)

func (*WatchWebDocumentStatusRequest) String

func (*WatchWebDocumentStatusRequest) UnmarshalJSON

func (x *WatchWebDocumentStatusRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the WatchWebDocumentStatusRequest from JSON.

func (*WatchWebDocumentStatusRequest) UnmarshalProtoJSON

func (x *WatchWebDocumentStatusRequest) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the WatchWebDocumentStatusRequest message from JSON.

func (*WatchWebDocumentStatusRequest) UnmarshalVT

func (m *WatchWebDocumentStatusRequest) UnmarshalVT(dAtA []byte) error

type WebDocument

type WebDocument interface {
	// Execute executes the web document.
	// Returns any errors, nil if Execute is not required.
	// This should only be called by the web runtime controller!
	Execute(ctx context.Context) error

	// GetWebDocumentUuid returns the web document identifier.
	GetWebDocumentUuid() string

	// GetWebDocumentStatusCtr contains a full snapshot of the web document status.
	// contains nil until the remote is ready or closed
	GetWebDocumentStatusCtr() *ccontainer.CContainer[*WebDocumentStatus]

	// GetWebViews returns the current snapshot of active WebViews.
	GetWebViews(ctx context.Context) (map[string]web_view.WebView, error)

	// GetWebView waits for the remote to be ready & returns the given WebView.
	// If wait is set, waits for the web view ID to exist.
	// Otherwise, returns nil, nil if not found.
	GetWebView(ctx context.Context, webViewID string, wait bool) (web_view.WebView, error)

	// GetWebWorkers returns the current snapshot of active WebWorkers.
	GetWebWorkers(ctx context.Context) (map[string]web_worker.WebWorker, error)

	// GetWebWorker waits for the remote to be ready & returns the given WebWorker.
	// If wait is set, waits for the web worker ID to exist.
	// Otherwise, returns nil, nil if not found.
	GetWebWorker(ctx context.Context, webWorkerID string, wait bool) (web_worker.WebWorker, error)

	// WaitReady waits for the state to be ready.
	WaitReady(ctx context.Context) error

	// WaitFirstWebView waits for at least one WebView to exist.
	WaitFirstWebView(ctx context.Context) (web_view.WebView, error)

	// CreateWebView creates a new web view.
	//
	// Returns false, nil if the document was hidden or view cannot be created.
	CreateWebView(ctx context.Context, webViewID string) (bool, error)

	// CreateWebWorker creates a new web worker.
	//
	// Returns ErrWebWorkerUnavailable if WebWorker is not available or cannot be created.
	// If shared is set, attempts to create a SharedWorker (but might not if not supported).
	// Returns nil, nil if the worker was not created.
	// If the worker already existed it will be deleted and recreated.
	CreateWebWorker(ctx context.Context, req *CreateWebWorkerRequest) (web_worker.WebWorker, error)
}

WebDocument is a tree of WebView managed separately from other WebDocument instances.

type WebDocumentConfig

type WebDocumentConfig interface {
	// Config indicates this is a controllerbus config object.
	config.Config
}

RuntimeConfig is a configuration for the runtime controller.

type WebDocumentConstructor

type WebDocumentConstructor func(
	ctx context.Context,
	le *logrus.Entry,
	handler WebDocumentHandler,
) (WebDocument, error)

WebDocumentConstructor constructs a runtime with common parameters.

type WebDocumentController

type WebDocumentController interface {
	// Controller indicates this is a controller bus controller.
	controller.Controller
	// GetWebDocument returns the controlled WebDocument.
	GetWebDocument() WebDocument
}

WebDocumentController is a controller managing a WebDocument.

type WebDocumentHandler

type WebDocumentHandler interface {
	// HandleWebView handles an incoming WebView.
	HandleWebView(ctx context.Context, view web_view.WebView)
}

WebDocumentHandler is the handler (usually WebDocumentController) for the document.

type WebDocumentStatus

type WebDocumentStatus struct {

	// Snapshot indicates this is a full snapshot of the lists.
	Snapshot bool `protobuf:"varint,1,opt,name=snapshot,proto3" json:"snapshot,omitempty"`
	// Hidden indicates that the web document is not visible.
	// The web document will unload all web views and suspend itself.
	// Background pages are throttled in web browsers.
	Hidden bool `protobuf:"varint,2,opt,name=hidden,proto3" json:"hidden,omitempty"`
	// WebViews contains the list of web view statuses.
	WebViews []*WebViewStatus `protobuf:"bytes,3,rep,name=web_views,json=webViews,proto3" json:"webViews,omitempty"`
	// WebWorkers contains the list of web worker statuses.
	WebWorkers []*WebWorkerStatus `protobuf:"bytes,4,rep,name=web_workers,json=webWorkers,proto3" json:"webWorkers,omitempty"`
	// Closed indicates the web document is closed.
	Closed bool `protobuf:"varint,5,opt,name=closed,proto3" json:"closed,omitempty"`
	// contains filtered or unexported fields
}

WebDocumentStatus contains a snapshot of status for a Document instance.

func (*WebDocumentStatus) CloneMessageVT

func (m *WebDocumentStatus) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*WebDocumentStatus) CloneVT

func (m *WebDocumentStatus) CloneVT() *WebDocumentStatus

func (*WebDocumentStatus) EqualMessageVT

func (this *WebDocumentStatus) EqualMessageVT(thatMsg any) bool

func (*WebDocumentStatus) EqualVT

func (this *WebDocumentStatus) EqualVT(that *WebDocumentStatus) bool

func (*WebDocumentStatus) GetClosed

func (x *WebDocumentStatus) GetClosed() bool

func (*WebDocumentStatus) GetHidden

func (x *WebDocumentStatus) GetHidden() bool

func (*WebDocumentStatus) GetSnapshot

func (x *WebDocumentStatus) GetSnapshot() bool

func (*WebDocumentStatus) GetWebViews

func (x *WebDocumentStatus) GetWebViews() []*WebViewStatus

func (*WebDocumentStatus) GetWebWorkers

func (x *WebDocumentStatus) GetWebWorkers() []*WebWorkerStatus

func (*WebDocumentStatus) MarshalJSON

func (x *WebDocumentStatus) MarshalJSON() ([]byte, error)

MarshalJSON marshals the WebDocumentStatus to JSON.

func (*WebDocumentStatus) MarshalProtoJSON

func (x *WebDocumentStatus) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the WebDocumentStatus message to JSON.

func (*WebDocumentStatus) MarshalProtoText

func (x *WebDocumentStatus) MarshalProtoText() string

func (*WebDocumentStatus) MarshalToSizedBufferVT

func (m *WebDocumentStatus) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*WebDocumentStatus) MarshalToVT

func (m *WebDocumentStatus) MarshalToVT(dAtA []byte) (int, error)

func (*WebDocumentStatus) MarshalVT

func (m *WebDocumentStatus) MarshalVT() (dAtA []byte, err error)

func (*WebDocumentStatus) ProtoMessage

func (*WebDocumentStatus) ProtoMessage()

func (*WebDocumentStatus) Reset

func (x *WebDocumentStatus) Reset()

func (*WebDocumentStatus) SizeVT

func (m *WebDocumentStatus) SizeVT() (n int)

func (*WebDocumentStatus) String

func (x *WebDocumentStatus) String() string

func (*WebDocumentStatus) UnmarshalJSON

func (x *WebDocumentStatus) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the WebDocumentStatus from JSON.

func (*WebDocumentStatus) UnmarshalProtoJSON

func (x *WebDocumentStatus) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the WebDocumentStatus message from JSON.

func (*WebDocumentStatus) UnmarshalVT

func (m *WebDocumentStatus) UnmarshalVT(dAtA []byte) error

type WebViewStatus

type WebViewStatus struct {

	// Id is the unique identifier for the webview.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Deleted indicates the web view was just removed.
	// If set, all below fields are ignored.
	Deleted bool `protobuf:"varint,2,opt,name=deleted,proto3" json:"deleted,omitempty"`
	// ParentId is the unique identifier for the parent web view.
	// May be empty.
	ParentId string `protobuf:"bytes,3,opt,name=parent_id,json=parentId,proto3" json:"parentId,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
}

WebViewStatus contains status for a web view.

func (*WebViewStatus) CloneMessageVT

func (m *WebViewStatus) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*WebViewStatus) CloneVT

func (m *WebViewStatus) CloneVT() *WebViewStatus

func (*WebViewStatus) EqualMessageVT

func (this *WebViewStatus) EqualMessageVT(thatMsg any) bool

func (*WebViewStatus) EqualVT

func (this *WebViewStatus) EqualVT(that *WebViewStatus) bool

func (*WebViewStatus) GetDeleted

func (x *WebViewStatus) GetDeleted() bool

func (*WebViewStatus) GetId

func (x *WebViewStatus) GetId() string

func (*WebViewStatus) GetParentId

func (x *WebViewStatus) GetParentId() string

func (*WebViewStatus) GetPermanent

func (x *WebViewStatus) GetPermanent() bool

func (*WebViewStatus) MarshalJSON

func (x *WebViewStatus) MarshalJSON() ([]byte, error)

MarshalJSON marshals the WebViewStatus to JSON.

func (*WebViewStatus) MarshalProtoJSON

func (x *WebViewStatus) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the WebViewStatus message to JSON.

func (*WebViewStatus) MarshalProtoText

func (x *WebViewStatus) MarshalProtoText() string

func (*WebViewStatus) MarshalToSizedBufferVT

func (m *WebViewStatus) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*WebViewStatus) MarshalToVT

func (m *WebViewStatus) MarshalToVT(dAtA []byte) (int, error)

func (*WebViewStatus) MarshalVT

func (m *WebViewStatus) MarshalVT() (dAtA []byte, err error)

func (*WebViewStatus) ProtoMessage

func (*WebViewStatus) ProtoMessage()

func (*WebViewStatus) Reset

func (x *WebViewStatus) Reset()

func (*WebViewStatus) SizeVT

func (m *WebViewStatus) SizeVT() (n int)

func (*WebViewStatus) String

func (x *WebViewStatus) String() string

func (*WebViewStatus) UnmarshalJSON

func (x *WebViewStatus) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the WebViewStatus from JSON.

func (*WebViewStatus) UnmarshalProtoJSON

func (x *WebViewStatus) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the WebViewStatus message from JSON.

func (*WebViewStatus) UnmarshalVT

func (m *WebViewStatus) UnmarshalVT(dAtA []byte) error

type WebWorkerMode

type WebWorkerMode int32

WebWorkerMode specifies whether a worker should be shared or dedicated.

const (
	// WORKER_MODE_DEFAULT preserves the legacy behavior for callers that do
	// not specify a mode.
	WebWorkerMode_WORKER_MODE_DEFAULT WebWorkerMode = 0
	// WORKER_MODE_SHARED requests a SharedWorker when supported.
	WebWorkerMode_WORKER_MODE_SHARED WebWorkerMode = 1
	// WORKER_MODE_DEDICATED requests a dedicated Worker.
	WebWorkerMode_WORKER_MODE_DEDICATED WebWorkerMode = 2
)

func (WebWorkerMode) Enum

func (x WebWorkerMode) Enum() *WebWorkerMode

func (WebWorkerMode) MarshalJSON

func (x WebWorkerMode) MarshalJSON() ([]byte, error)

MarshalJSON marshals the WebWorkerMode to JSON.

func (WebWorkerMode) MarshalProtoJSON

func (x WebWorkerMode) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the WebWorkerMode to JSON.

func (WebWorkerMode) MarshalProtoText

func (x WebWorkerMode) MarshalProtoText() string

func (WebWorkerMode) MarshalText

func (x WebWorkerMode) MarshalText() ([]byte, error)

MarshalText marshals the WebWorkerMode to text.

func (WebWorkerMode) String

func (x WebWorkerMode) String() string

func (*WebWorkerMode) UnmarshalJSON

func (x *WebWorkerMode) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the WebWorkerMode from JSON.

func (*WebWorkerMode) UnmarshalProtoJSON

func (x *WebWorkerMode) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the WebWorkerMode from JSON.

func (*WebWorkerMode) UnmarshalText

func (x *WebWorkerMode) UnmarshalText(b []byte) error

UnmarshalText unmarshals the WebWorkerMode from text.

type WebWorkerStatus

type WebWorkerStatus struct {

	// Id is the unique identifier for the worker.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Deleted indicates the web worker was just removed.
	// If set, all below fields are ignored.
	Deleted bool `protobuf:"varint,2,opt,name=deleted,proto3" json:"deleted,omitempty"`
	// Shared indicates that the worker is a SharedWorker.
	Shared bool `protobuf:"varint,3,opt,name=shared,proto3" json:"shared,omitempty"`
	// Ready indicates the worker finished startup and registered with WebRuntime.
	Ready bool `protobuf:"varint,4,opt,name=ready,proto3" json:"ready,omitempty"`
	// contains filtered or unexported fields
}

WebWorkerStatus contains status for a web worker.

func (*WebWorkerStatus) CloneMessageVT

func (m *WebWorkerStatus) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*WebWorkerStatus) CloneVT

func (m *WebWorkerStatus) CloneVT() *WebWorkerStatus

func (*WebWorkerStatus) EqualMessageVT

func (this *WebWorkerStatus) EqualMessageVT(thatMsg any) bool

func (*WebWorkerStatus) EqualVT

func (this *WebWorkerStatus) EqualVT(that *WebWorkerStatus) bool

func (*WebWorkerStatus) GetDeleted

func (x *WebWorkerStatus) GetDeleted() bool

func (*WebWorkerStatus) GetId

func (x *WebWorkerStatus) GetId() string

func (*WebWorkerStatus) GetReady

func (x *WebWorkerStatus) GetReady() bool

func (*WebWorkerStatus) GetShared

func (x *WebWorkerStatus) GetShared() bool

func (*WebWorkerStatus) MarshalJSON

func (x *WebWorkerStatus) MarshalJSON() ([]byte, error)

MarshalJSON marshals the WebWorkerStatus to JSON.

func (*WebWorkerStatus) MarshalProtoJSON

func (x *WebWorkerStatus) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the WebWorkerStatus message to JSON.

func (*WebWorkerStatus) MarshalProtoText

func (x *WebWorkerStatus) MarshalProtoText() string

func (*WebWorkerStatus) MarshalToSizedBufferVT

func (m *WebWorkerStatus) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*WebWorkerStatus) MarshalToVT

func (m *WebWorkerStatus) MarshalToVT(dAtA []byte) (int, error)

func (*WebWorkerStatus) MarshalVT

func (m *WebWorkerStatus) MarshalVT() (dAtA []byte, err error)

func (*WebWorkerStatus) ProtoMessage

func (*WebWorkerStatus) ProtoMessage()

func (*WebWorkerStatus) Reset

func (x *WebWorkerStatus) Reset()

func (*WebWorkerStatus) SizeVT

func (m *WebWorkerStatus) SizeVT() (n int)

func (*WebWorkerStatus) String

func (x *WebWorkerStatus) String() string

func (*WebWorkerStatus) UnmarshalJSON

func (x *WebWorkerStatus) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the WebWorkerStatus from JSON.

func (*WebWorkerStatus) UnmarshalProtoJSON

func (x *WebWorkerStatus) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the WebWorkerStatus message from JSON.

func (*WebWorkerStatus) UnmarshalVT

func (m *WebWorkerStatus) UnmarshalVT(dAtA []byte) error

type WebWorkerType

type WebWorkerType int32

WebWorkerType specifies the type of worker to create.

const (
	// WEB_WORKER_TYPE_NATIVE creates a native JS SharedWorker that imports the plugin directly.
	// This is used for "web/js/wasm" platform plugins (Go WASM).
	WebWorkerType_WEB_WORKER_TYPE_NATIVE WebWorkerType = 0
	// WEB_WORKER_TYPE_QUICKJS creates a SharedWorker that runs QuickJS WASI reactor.
	// This is used for "js" platform plugins. The unified shared-worker.ts dispatches
	// to quickjs-runner.ts which loads the QuickJS reactor WASM and runs the plugin.
	WebWorkerType_WEB_WORKER_TYPE_QUICKJS WebWorkerType = 1
)

func (WebWorkerType) Enum

func (x WebWorkerType) Enum() *WebWorkerType

func (WebWorkerType) MarshalJSON

func (x WebWorkerType) MarshalJSON() ([]byte, error)

MarshalJSON marshals the WebWorkerType to JSON.

func (WebWorkerType) MarshalProtoJSON

func (x WebWorkerType) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the WebWorkerType to JSON.

func (WebWorkerType) MarshalProtoText

func (x WebWorkerType) MarshalProtoText() string

func (WebWorkerType) MarshalText

func (x WebWorkerType) MarshalText() ([]byte, error)

MarshalText marshals the WebWorkerType to text.

func (WebWorkerType) String

func (x WebWorkerType) String() string

func (*WebWorkerType) UnmarshalJSON

func (x *WebWorkerType) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the WebWorkerType from JSON.

func (*WebWorkerType) UnmarshalProtoJSON

func (x *WebWorkerType) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the WebWorkerType from JSON.

func (*WebWorkerType) UnmarshalText

func (x *WebWorkerType) UnmarshalText(b []byte) error

UnmarshalText unmarshals the WebWorkerType from text.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL