lsps0: lsps0 server implementation

This commit is contained in:
Jesse de Wit
2023-08-11 08:49:57 +02:00
parent c23dc64df5
commit ef19a67e7a
7 changed files with 689 additions and 0 deletions

30
lsps0/jsonrpc/jsonrpc.go Normal file
View File

@@ -0,0 +1,30 @@
package jsonrpc
import "encoding/json"
var Version = "2.0"
type Request struct {
JsonRpc string `json:"jsonrpc"`
Method string `json:"method"`
Id string `json:"id"`
Params json.RawMessage `json:"params"`
}
type Response struct {
JsonRpc string `json:"jsonrpc"`
Id string `json:"id"`
Result json.RawMessage `json:"result"`
}
type Error struct {
JsonRpc string `json:"jsonrpc"`
Id *string `json:"id"`
Error ErrorBody `json:"error"`
}
type ErrorBody struct {
Code int32 `json:"code"`
Message string `json:"message"`
Data json.RawMessage `json:"data,omitempty"`
}