Documentation
¶
Index ¶
- Constants
- Variables
- func DoEvmQuery(host string, qb JsonRpcQueryBuilder, optionalTimeout time.Duration) ([]byte, error)
- func IsErrUpstreamRpcReturnedError(err error) bool
- func ParseJsonRpcResponse[T any](bz []byte) (any, error)
- func WrapAppContext(ctx Context) context.Context
- type Context
- type ContextKey
- type JsonRpcQueryBuilder
- type JsonRpcQueryParam
- func NewJsonRpcBoolQueryParam(value bool) JsonRpcQueryParam
- func NewJsonRpcInt64QueryParam(num int64) JsonRpcQueryParam
- func NewJsonRpcIntQueryParam(num int) JsonRpcQueryParam
- func NewJsonRpcRawQueryParam(rawStr string) JsonRpcQueryParam
- func NewJsonRpcStringArrayQueryParam(strArr ...string) (JsonRpcQueryParam, error)
- func NewJsonRpcStringQueryParam(str string) (JsonRpcQueryParam, error)
Constants ¶
View Source
const AppContextKey = constants.BINARY_NAME + "-app-context"
AppContextKey is the key in the context.Context which holds the application context.
Variables ¶
View Source
var ErrUpstreamRpcReturnedError = errors.New("upstream RPC returned error")
ErrUpstreamRpcReturnedError is the error when the upstream RPC returned error
Functions ¶
func DoEvmQuery ¶ added in v2.2.0
func IsErrUpstreamRpcReturnedError ¶
IsErrUpstreamRpcReturnedError returns true if the error is built from upstream RPC response error, when error code is not zero.
func WrapAppContext ¶
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶
func NewContext() Context
func UnwrapAppContext ¶
type JsonRpcQueryBuilder ¶
type JsonRpcQueryBuilder interface {
String() string
}
func NewJsonRpcQueryBuilder ¶
func NewJsonRpcQueryBuilder( method string, params ...JsonRpcQueryParam, ) JsonRpcQueryBuilder
type JsonRpcQueryParam ¶
type JsonRpcQueryParam interface { // IsArray returns true if the param is array formed IsArray() bool // String returns string of the param String() string }
func NewJsonRpcBoolQueryParam ¶
func NewJsonRpcBoolQueryParam(value bool) JsonRpcQueryParam
func NewJsonRpcInt64QueryParam ¶
func NewJsonRpcInt64QueryParam(num int64) JsonRpcQueryParam
func NewJsonRpcIntQueryParam ¶
func NewJsonRpcIntQueryParam(num int) JsonRpcQueryParam
func NewJsonRpcRawQueryParam ¶
func NewJsonRpcRawQueryParam(rawStr string) JsonRpcQueryParam
func NewJsonRpcStringArrayQueryParam ¶
func NewJsonRpcStringArrayQueryParam(strArr ...string) (JsonRpcQueryParam, error)
func NewJsonRpcStringQueryParam ¶
func NewJsonRpcStringQueryParam(str string) (JsonRpcQueryParam, error)
Click to show internal directories.
Click to hide internal directories.