2024-06-22 15:37:15 +00:00
|
|
|
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.
|
2024-09-04 20:25:38 +00:00
|
|
|
Call(ctx context.Context, rcv any, method string, params ...any) error
|
2024-06-22 15:37:15 +00:00
|
|
|
}
|