mirror of
https://github.com/aljazceru/lspd.git
synced 2025-12-19 14:54:22 +01:00
31 lines
674 B
Go
31 lines
674 B
Go
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"`
|
|
}
|