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.
|
|
|
|
//
|
2024-09-23 17:04:14 +00:00
|
|
|
// 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.
|
|
|
|
//
|
2024-06-22 15:37:15 +00:00
|
|
|
// If an error result is returned from the server that will be returned as
|
|
|
|
// an Error struct.
|
2024-09-23 17:04:14 +00:00
|
|
|
Call(ctx context.Context, rcv any, method string, args ...any) error
|
2024-06-22 15:37:15 +00:00
|
|
|
}
|