Documentation ¶
Index ¶
Constants ¶
View Source
const ModuleName = "jungletv:rpc"
ModuleName is the name by which this module can be require()d in a script
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientEventData ¶
type InvocationResult ¶
type InvocationResult struct { Synchronous bool Value string // if synchronous AsyncResult <-chan PromiseResult }
type PageUserTuple ¶
type PromiseResult ¶
type RPCModule ¶
type RPCModule interface { modules.NativeModule // HandleInvocation must be called inside the event loop // returns either a goja.Value (if the method handler is synchronous) or a channel where a goja.Value will later be sent (if the method handler returns a Promise) HandleInvocation(vm *goja.Runtime, user auth.User, pageID, method string, args []string) InvocationResult // HandleEvent must be called inside the event loop HandleEvent(vm *goja.Runtime, user auth.User, trusted bool, pageID, event string, args []string) GlobalEventEmitted() event.Event[ClientEventData] PageEventEmitted() event.Keyed[string, ClientEventData] UserEventEmitted() event.Keyed[string, ClientEventData] PageUserEventEmitted() event.Keyed[PageUserTuple, ClientEventData] }
RPCModule manages client-initiated RPC for an application
Click to show internal directories.
Click to hide internal directories.