29 lines
835 B
Go
29 lines
835 B
Go
package helperclient
|
|
|
|
import "encoding/json"
|
|
|
|
const HelperProtocolV1 = "isphere.helper.v1"
|
|
|
|
type HelperRequest struct {
|
|
Protocol string `json:"protocol"`
|
|
RequestID string `json:"request_id"`
|
|
Op string `json:"op"`
|
|
TimeoutMS int `json:"timeout_ms"`
|
|
Args map[string]any `json:"args"`
|
|
}
|
|
|
|
type HelperResponse struct {
|
|
Protocol string `json:"protocol"`
|
|
RequestID string `json:"request_id"`
|
|
Op string `json:"op"`
|
|
OK bool `json:"ok"`
|
|
Data map[string]json.RawMessage `json:"data"`
|
|
Error *HelperError `json:"error"`
|
|
Warnings []string `json:"warnings"`
|
|
}
|
|
|
|
type HelperError struct {
|
|
Code string `json:"code"`
|
|
Message string `json:"message"`
|
|
}
|