wsh rpc client

This commit is contained in:
sawka
2024-05-29 23:17:23 -07:00
parent 2472deb379
commit 45f20bb5c3
5 changed files with 449 additions and 2 deletions
+12
View File
@@ -9,6 +9,7 @@ const (
CommandSetView = "setview"
CommandSetMeta = "setmeta"
CommandBlockFileAppend = "blockfile:append"
CommandStreamFile = "streamfile"
)
var CommandToTypeMap = map[string]reflect.Type{
@@ -23,6 +24,8 @@ type Command interface {
// for unmarshalling
type baseCommand struct {
Command string `json:"command"`
RpcID string `json:"rpcid"`
RpcType string `json:"rpctype"`
}
type SetViewCommand struct {
@@ -52,3 +55,12 @@ type BlockFileAppendCommand struct {
func (bfac *BlockFileAppendCommand) GetCommand() string {
return CommandBlockFileAppend
}
type StreamFileCommand struct {
Command string `json:"command"`
FileName string `json:"filename"`
}
func (c *StreamFileCommand) GetCommand() string {
return CommandStreamFile
}