Newer
Older
// 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