isle/go/daemon/jsonrpc2/client.go

20 lines
586 B
Go

package jsonrpc2
import (
"context"
)
// Client is used to perform requests against a JSONRPC2 server. The Client
// should be discarded after any error which is not an Error.
type Client interface {
// Call performs a single round-trip request.
//
// The result of the request will be JSON unmarshaled into the given
// receiver pointer, unless it is nil in which case the result will be
// discarded.
//
// If an error result is returned from the server that will be returned as
// an Error struct.
Call(ctx context.Context, rcv any, method string, params ...any) error
}