Newer
Older
"gfx.cafe/open/jrpc/pkg/server"
)
// to make the repo cleaner, we export everything here. this way the packages dont need to ever import this
// Conn is used to make requests to jsonrpc2 servers
type Conn interface {
// DialContext is to dial a conn with context
DialContext = codecs.DialContext
// Dial is to dial a conn with context.Background()
Dial = codecs.Dial
func Do[T any](ctx context.Context, c Conn, method string, args any) (*T, error) {
// Call will use the conn to perform a jsonrpc2 call, except the args will be encoded as an array of arguments.
func Call[T any](ctx context.Context, c Conn, method string, args ...any) (*T, error) {
// CallInto is the same as Call, except instead of returning, you provide a pointer to the result