isle/go/daemon/jsonrpc2/client.go

24 lines
750 B
Go
Raw Normal View History

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 the Context was produced using WithMeta then that metadata will be
// carried with the request to the server via the Meta field of the
// RequestParams.
//
// 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, args ...any) error
}