core

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package core contains common interfaces used for RPC method implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallFactoryReturns deprecated added in v0.6.0

type CallFactoryReturns[T any] interface {

	// Returns given argument points to the variable in which to store the
	// calls result.
	Returns(*T) Caller
}

Deprecated: CallFactoryReturns is the interface that wraps the basic Returns method.

type CallFactoryReturnsRAW deprecated added in v0.6.0

type CallFactoryReturnsRAW[T any] interface {

	// ReturnsRAW given argument points to the variable in which to store the
	// calls result.
	ReturnsRAW(*T) Caller
}

Deprecated: CallFactoryReturnsRAW is the interface that wraps the basic ReturnsRAW method.

type Caller added in v0.5.0

type Caller interface {
	RequestCreator
	ResponseHandler
}

Caller is the interface that groups the basic CreateRequest and HandleResponse methods.

type CallerFactory added in v0.8.0

type CallerFactory[T any] interface {

	// Returns given argument points to the variable in which to store the
	// calls result.
	Returns(*T) Caller
}

CallerFactory is the interface that wraps the basic Returns method.

type Func

type Func interface {

	// EncodeArgs ABI-encodes the given args and prepends the Func's 4-byte
	// selector.
	EncodeArgs(args ...any) (input []byte, err error)

	// DecodeArgs ABI-decodes the given input to the given args.
	DecodeArgs(input []byte, args ...any) (err error)

	// DecodeReturns ABI-decodes the given output to the given returns.
	DecodeReturns(output []byte, returns ...any) (err error)
}

Func is the interface that wraps the methods for ABI encoding and decoding.

type RequestCreator added in v0.3.1

type RequestCreator interface {
	CreateRequest() (elem rpc.BatchElem, err error)
}

RequestCreator is the interface that wraps the basic CreateRequest method.

type ResponseHandler

type ResponseHandler interface {
	HandleResponse(elem rpc.BatchElem) (err error)
}

ResponseHandler is the interface that wraps the basic HandleResponse method.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL