isle/go/daemon/jsonrpc2/client.go
Brian Picciano 16aca610b4 Add multi-network support to daemon
It's still not possible to pick a network from the command-line, so this
is a bit broken, but the daemon component should handle it correctly at
least.
2024-09-23 19:04:14 +02:00

24 lines
750 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 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
}