Documentation ¶
Overview ¶
types and methods for wsh rpc calls
Index ¶
- Constants
- func GenerateWshCommandDeclMap() map[string]*WshRpcMethodDecl
- func HackRpcContextIntoData(dataPtr any, rpcContext RpcContext)
- func MakeMethodMapForImpl(impl any, declMap map[string]*WshRpcMethodDecl) map[string]reflect.Method
- type AiMessageData
- type BlockInfoData
- type CommandAppendIJsonData
- type CommandAuthenticateRtnData
- type CommandBlockInputData
- type CommandBlockSetViewData
- type CommandControllerResyncData
- type CommandCreateBlockData
- type CommandCreateSubBlockData
- type CommandDeleteBlockData
- type CommandDisposeData
- type CommandEventReadHistoryData
- type CommandFileCreateData
- type CommandFileData
- type CommandFileDataAt
- type CommandFileListData
- type CommandGetMetaData
- type CommandMessageData
- type CommandRemoteStreamFileData
- type CommandRemoteStreamFileRtnData
- type CommandRemoteWriteFileData
- type CommandResolveIdsData
- type CommandResolveIdsRtnData
- type CommandSetMetaData
- type CommandVarData
- type CommandVarResponseData
- type CommandWaitForRouteData
- type CommandWebSelectorData
- type ConnStatus
- type CpuDataRequest
- type CpuDataType
- type FileInfo
- type OpenAIOptsType
- type OpenAIPacketType
- type OpenAIPromptMessageType
- type OpenAIUsageType
- type OpenAiStreamRequest
- type RespOrErrorUnion
- type RpcContext
- type RpcOpts
- type TimeSeriesData
- type VDomUrlRequestData
- type VDomUrlRequestResponse
- type WaveFileInfo
- type WaveInfoData
- type WaveNotificationOptions
- type WebSelectorOpts
- type WshRpcInterface
- type WshRpcMethodDecl
- type WshServerCommandMeta
Constants ¶
View Source
const ( RpcType_Call = "call" // single response (regular rpc) RpcType_ResponseStream = "responsestream" // stream of responses (streaming rpc) RpcType_StreamingRequest = "streamingrequest" // streaming request RpcType_Complex = "complex" // streaming request/response )
View Source
const ( Command_Authenticate = "authenticate" // special Command_Dispose = "dispose" // special (disposes of the route, for multiproxy only) Command_RouteAnnounce = "routeannounce" // special (for routing) Command_RouteUnannounce = "routeunannounce" // special (for routing) Command_Message = "message" Command_GetMeta = "getmeta" Command_SetMeta = "setmeta" Command_SetView = "setview" Command_ControllerInput = "controllerinput" Command_ControllerRestart = "controllerrestart" Command_ControllerStop = "controllerstop" Command_ControllerResync = "controllerresync" Command_FileAppend = "fileappend" Command_FileAppendIJson = "fileappendijson" Command_ResolveIds = "resolveids" Command_BlockInfo = "blockinfo" Command_CreateBlock = "createblock" Command_DeleteBlock = "deleteblock" Command_FileWrite = "filewrite" Command_FileRead = "fileread" Command_EventPublish = "eventpublish" Command_EventRecv = "eventrecv" Command_EventSub = "eventsub" Command_EventUnsub = "eventunsub" Command_EventUnsubAll = "eventunsuball" Command_EventReadHistory = "eventreadhistory" Command_StreamTest = "streamtest" Command_StreamWaveAi = "streamwaveai" Command_StreamCpuData = "streamcpudata" Command_Test = "test" Command_RemoteStreamFile = "remotestreamfile" Command_RemoteFileInfo = "remotefileinfo" Command_RemoteWriteFile = "remotewritefile" Command_RemoteFileDelete = "remotefiledelete" Command_RemoteFileJoin = "remotefilejoin" Command_WaveInfo = "waveinfo" Command_WshActivity = "wshactivity" Command_Activity = "activity" Command_GetVar = "getvar" Command_SetVar = "setvar" Command_ConnStatus = "connstatus" Command_WslStatus = "wslstatus" Command_ConnEnsure = "connensure" Command_ConnReinstallWsh = "connreinstallwsh" Command_ConnConnect = "connconnect" Command_ConnDisconnect = "conndisconnect" Command_ConnList = "connlist" Command_WslList = "wsllist" Command_WslDefaultDistro = "wsldefaultdistro" Command_WebSelector = "webselector" Command_Notify = "notify" Command_GetUpdateChannel = "getupdatechannel" Command_VDomCreateContext = "vdomcreatecontext" Command_VDomAsyncInitiation = "vdomasyncinitiation" Command_VDomRender = "vdomrender" Command_VDomUrlRequest = "vdomurlrequest" Command_AiSendMessage = "aisendmessage" )
View Source
const ( ClientType_ConnServer = "connserver" ClientType_BlockController = "blockcontroller" )
View Source
const LocalConnName = "local"
View Source
const (
TimeSeries_Cpu = "cpu"
)
Variables ¶
This section is empty.
Functions ¶
func GenerateWshCommandDeclMap ¶
func GenerateWshCommandDeclMap() map[string]*WshRpcMethodDecl
func HackRpcContextIntoData ¶
func HackRpcContextIntoData(dataPtr any, rpcContext RpcContext)
func MakeMethodMapForImpl ¶
Types ¶
type AiMessageData ¶ added in v0.9.2
type AiMessageData struct {
Message string `json:"message,omitempty"`
}
type BlockInfoData ¶
type CommandAppendIJsonData ¶
type CommandBlockInputData ¶
type CommandBlockSetViewData ¶
type CommandControllerResyncData ¶
type CommandControllerResyncData struct { ForceRestart bool `json:"forcerestart,omitempty"` TabId string `json:"tabid" wshcontext:"TabId"` BlockId string `json:"blockid" wshcontext:"BlockId"` RtOpts *waveobj.RuntimeOpts `json:"rtopts,omitempty"` }
type CommandCreateBlockData ¶
type CommandCreateSubBlockData ¶ added in v0.9.0
type CommandDeleteBlockData ¶
type CommandDeleteBlockData struct {
BlockId string `json:"blockid" wshcontext:"BlockId"`
}
type CommandDisposeData ¶ added in v0.9.0
type CommandDisposeData struct {
RouteId string `json:"routeid"`
}
type CommandFileCreateData ¶ added in v0.9.3
type CommandFileData ¶
type CommandFileData struct { ZoneId string `json:"zoneid" wshcontext:"BlockId"` FileName string `json:"filename"` Data64 string `json:"data64,omitempty"` At *CommandFileDataAt `json:"at,omitempty"` // if set, this turns read/write ops to ReadAt/WriteAt ops (len is only used for ReadAt) }
type CommandFileDataAt ¶ added in v0.9.3
type CommandFileListData ¶ added in v0.9.3
type CommandGetMetaData ¶
type CommandMessageData ¶
type CommandResolveIdsData ¶
type CommandSetMetaData ¶
type CommandSetMetaData struct { ORef waveobj.ORef `json:"oref" wshcontext:"BlockORef"` Meta waveobj.MetaMapType `json:"meta"` }
type CommandVarData ¶ added in v0.9.3
type CommandVarResponseData ¶ added in v0.9.3
type CommandWaitForRouteData ¶ added in v0.9.0
type CommandWebSelectorData ¶
type CommandWebSelectorData struct { WindowId string `json:"windowid"` BlockId string `json:"blockid" wshcontext:"BlockId"` TabId string `json:"tabid" wshcontext:"TabId"` Selector string `json:"selector"` Opts *WebSelectorOpts `json:"opts,omitempty"` }
type ConnStatus ¶
type CpuDataRequest ¶
type CpuDataType ¶
type FileInfo ¶
type FileInfo struct { Path string `json:"path"` // cleaned path (may have "~") Dir string `json:"dir"` // returns the directory part of the path (if this is a a directory, it will be equal to Path). "~" will be expanded, and separators will be normalized to "/" Name string `json:"name"` NotFound bool `json:"notfound,omitempty"` Size int64 `json:"size"` Mode os.FileMode `json:"mode"` ModeStr string `json:"modestr"` ModTime int64 `json:"modtime"` IsDir bool `json:"isdir,omitempty"` MimeType string `json:"mimetype,omitempty"` ReadOnly bool `json:"readonly,omitempty"` // this is not set for fileinfo's returned from directory listings }
type OpenAIOptsType ¶
type OpenAIOptsType struct { Model string `json:"model"` APIType string `json:"apitype,omitempty"` APIToken string `json:"apitoken"` OrgID string `json:"orgid,omitempty"` APIVersion string `json:"apiversion,omitempty"` BaseURL string `json:"baseurl,omitempty"` MaxTokens int `json:"maxtokens,omitempty"` MaxChoices int `json:"maxchoices,omitempty"` TimeoutMs int `json:"timeoutms,omitempty"` }
type OpenAIPacketType ¶
type OpenAIPacketType struct { Type string `json:"type"` Model string `json:"model,omitempty"` Created int64 `json:"created,omitempty"` FinishReason string `json:"finish_reason,omitempty"` Usage *OpenAIUsageType `json:"usage,omitempty"` Index int `json:"index,omitempty"` Text string `json:"text,omitempty"` Error string `json:"error,omitempty"` }
type OpenAIPromptMessageType ¶
type OpenAIUsageType ¶
type OpenAiStreamRequest ¶
type OpenAiStreamRequest struct { ClientId string `json:"clientid,omitempty"` Opts *OpenAIOptsType `json:"opts"` Prompt []OpenAIPromptMessageType `json:"prompt"` }
type RespOrErrorUnion ¶
type RpcContext ¶
type TimeSeriesData ¶
type VDomUrlRequestData ¶ added in v0.9.2
type VDomUrlRequestResponse ¶ added in v0.9.2
type WaveFileInfo ¶ added in v0.9.3
type WaveFileInfo struct { ZoneId string `json:"zoneid"` Name string `json:"name"` Opts filestore.FileOptsType `json:"opts,omitempty"` Size int64 `json:"size,omitempty"` CreatedTs int64 `json:"createdts,omitempty"` ModTs int64 `json:"modts,omitempty"` Meta map[string]any `json:"meta,omitempty"` IsDir bool `json:"isdir,omitempty"` }
type WaveInfoData ¶ added in v0.9.1
type WaveNotificationOptions ¶ added in v0.8.9
type WebSelectorOpts ¶
type WshRpcInterface ¶
type WshRpcInterface interface { AuthenticateCommand(ctx context.Context, data string) (CommandAuthenticateRtnData, error) DisposeCommand(ctx context.Context, data CommandDisposeData) error RouteAnnounceCommand(ctx context.Context) error // (special) announces a new route to the main router RouteUnannounceCommand(ctx context.Context) error // (special) unannounces a route to the main router MessageCommand(ctx context.Context, data CommandMessageData) error GetMetaCommand(ctx context.Context, data CommandGetMetaData) (waveobj.MetaMapType, error) SetMetaCommand(ctx context.Context, data CommandSetMetaData) error SetViewCommand(ctx context.Context, data CommandBlockSetViewData) error ControllerInputCommand(ctx context.Context, data CommandBlockInputData) error ControllerStopCommand(ctx context.Context, blockId string) error ControllerResyncCommand(ctx context.Context, data CommandControllerResyncData) error ResolveIdsCommand(ctx context.Context, data CommandResolveIdsData) (CommandResolveIdsRtnData, error) CreateBlockCommand(ctx context.Context, data CommandCreateBlockData) (waveobj.ORef, error) CreateSubBlockCommand(ctx context.Context, data CommandCreateSubBlockData) (waveobj.ORef, error) DeleteBlockCommand(ctx context.Context, data CommandDeleteBlockData) error DeleteSubBlockCommand(ctx context.Context, data CommandDeleteBlockData) error WaitForRouteCommand(ctx context.Context, data CommandWaitForRouteData) (bool, error) FileCreateCommand(ctx context.Context, data CommandFileCreateData) error FileDeleteCommand(ctx context.Context, data CommandFileData) error FileAppendCommand(ctx context.Context, data CommandFileData) error FileAppendIJsonCommand(ctx context.Context, data CommandAppendIJsonData) error FileWriteCommand(ctx context.Context, data CommandFileData) error FileReadCommand(ctx context.Context, data CommandFileData) (string, error) FileInfoCommand(ctx context.Context, data CommandFileData) (*WaveFileInfo, error) FileListCommand(ctx context.Context, data CommandFileListData) ([]*WaveFileInfo, error) EventPublishCommand(ctx context.Context, data wps.WaveEvent) error EventSubCommand(ctx context.Context, data wps.SubscriptionRequest) error EventUnsubCommand(ctx context.Context, data string) error EventUnsubAllCommand(ctx context.Context) error EventReadHistoryCommand(ctx context.Context, data CommandEventReadHistoryData) ([]*wps.WaveEvent, error) StreamTestCommand(ctx context.Context) chan RespOrErrorUnion[int] StreamWaveAiCommand(ctx context.Context, request OpenAiStreamRequest) chan RespOrErrorUnion[OpenAIPacketType] StreamCpuDataCommand(ctx context.Context, request CpuDataRequest) chan RespOrErrorUnion[TimeSeriesData] TestCommand(ctx context.Context, data string) error SetConfigCommand(ctx context.Context, data wconfig.MetaSettingsType) error BlockInfoCommand(ctx context.Context, blockId string) (*BlockInfoData, error) WaveInfoCommand(ctx context.Context) (*WaveInfoData, error) WshActivityCommand(ct context.Context, data map[string]int) error ActivityCommand(ctx context.Context, data telemetry.ActivityUpdate) error GetVarCommand(ctx context.Context, data CommandVarData) (*CommandVarResponseData, error) SetVarCommand(ctx context.Context, data CommandVarData) error // connection functions ConnStatusCommand(ctx context.Context) ([]ConnStatus, error) WslStatusCommand(ctx context.Context) ([]ConnStatus, error) ConnEnsureCommand(ctx context.Context, connName string) error ConnReinstallWshCommand(ctx context.Context, connName string) error ConnConnectCommand(ctx context.Context, connName string) error ConnDisconnectCommand(ctx context.Context, connName string) error ConnListCommand(ctx context.Context) ([]string, error) WslListCommand(ctx context.Context) ([]string, error) WslDefaultDistroCommand(ctx context.Context) (string, error) // eventrecv is special, it's handled internally by WshRpc with EventListener EventRecvCommand(ctx context.Context, data wps.WaveEvent) error // remotes RemoteStreamFileCommand(ctx context.Context, data CommandRemoteStreamFileData) chan RespOrErrorUnion[CommandRemoteStreamFileRtnData] RemoteFileInfoCommand(ctx context.Context, path string) (*FileInfo, error) RemoteFileDeleteCommand(ctx context.Context, path string) error RemoteWriteFileCommand(ctx context.Context, data CommandRemoteWriteFileData) error RemoteFileJoinCommand(ctx context.Context, paths []string) (*FileInfo, error) RemoteStreamCpuDataCommand(ctx context.Context) chan RespOrErrorUnion[TimeSeriesData] // emain WebSelectorCommand(ctx context.Context, data CommandWebSelectorData) ([]string, error) NotifyCommand(ctx context.Context, notificationOptions WaveNotificationOptions) error GetUpdateChannelCommand(ctx context.Context) (string, error) // terminal VDomCreateContextCommand(ctx context.Context, data vdom.VDomCreateContext) (*waveobj.ORef, error) VDomAsyncInitiationCommand(ctx context.Context, data vdom.VDomAsyncInitiationRequest) error // ai AiSendMessageCommand(ctx context.Context, data AiMessageData) error // proc VDomRenderCommand(ctx context.Context, data vdom.VDomFrontendUpdate) chan RespOrErrorUnion[*vdom.VDomBackendUpdate] VDomUrlRequestCommand(ctx context.Context, data VDomUrlRequestData) chan RespOrErrorUnion[VDomUrlRequestResponse] }
type WshRpcMethodDecl ¶
type WshServerCommandMeta ¶
type WshServerCommandMeta struct {
CommandType string `json:"commandtype"`
}
for frontend
Click to show internal directories.
Click to hide internal directories.