Documentation ¶
Index ¶
Constants ¶
View Source
const ( PendingBlockNumber = BlockNumber(-2) LatestBlockNumber = BlockNumber(-1) EarliestBlockNumber = BlockNumber(0) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockNumber ¶ added in v1.1.0
type BlockNumber int64
func (BlockNumber) MarshalJSON ¶ added in v1.1.0
func (bn BlockNumber) MarshalJSON() ([]byte, error)
func (*BlockNumber) UnmarshalJSON ¶ added in v1.1.0
func (bn *BlockNumber) UnmarshalJSON(data []byte) error
type Call ¶ added in v0.0.18
type Call struct { Version string `json:"jsonrpc"` ID json.RawMessage `json:"id"` Method string `json:"method"` Params []json.RawMessage `json:"params"` }
func NewCallParams ¶ added in v0.0.18
func NewCallParams(method string, rawparams []json.RawMessage) (*Call, error)
type CallContext ¶ added in v0.0.4
type CallContext struct { Latest int64 Await func(int64) bool // contains filtered or unexported fields }
func (*CallContext) Context ¶ added in v0.0.4
func (c *CallContext) Context() context.Context
func (*CallContext) Get ¶ added in v0.0.6
func (cm *CallContext) Get(key string) (interface{}, bool)
func (*CallContext) Metadata ¶ added in v0.0.4
func (c *CallContext) Metadata() *CallMetadata
func (*CallContext) Set ¶ added in v0.0.6
func (cm *CallContext) Set(key string, value interface{})
type CallMetadata ¶
func (*CallMetadata) AddBigCompute ¶ added in v0.0.4
func (cm *CallMetadata) AddBigCompute(x *big.Int)
func (*CallMetadata) AddCompute ¶ added in v0.0.4
func (cm *CallMetadata) AddCompute(x uint64)
type Checks ¶ added in v0.0.6
type Checks []Check
func (Checks) Healthy ¶ added in v0.0.6
func (c Checks) Healthy() HealthStatus
func (Checks) Start ¶ added in v0.0.6
func (c Checks) Start(r RegistryCallable)
type HealthCheck ¶ added in v0.0.6
type HealthCheck interface {
Healthy() HealthStatus
}
type HealthStatus ¶ added in v0.0.6
type HealthStatus int
const ( Healthy HealthStatus = iota Warning )
type Middleware ¶ added in v0.0.6
type Middleware interface { Enter(*CallContext, string, []json.RawMessage) (interface{}, *RPCError) Exit(*CallContext, interface{}, *RPCError) (interface{}, *RPCError) }
type RPCError ¶
type RPCError struct { C int `json:"code"` Msg string `json:"message"` Data interface{} `json:"data,omitempty"` }
func NewRPCError ¶
func NewRPCErrorWithData ¶ added in v0.0.13
type RawResponse ¶ added in v0.0.18
type RawResponse struct { Version string `json:"jsonrpc"` ID json.RawMessage `json:"id"` Error *RPCError `json:"error,omitempty"` Result json.RawMessage `json:"result,omitempty"` Params json.RawMessage `json:"params,omitempty"` Meta *CallMetadata `json:"-"` }
type Registry ¶
type Registry interface { RegistryCallable Register(namespace string, service interface{}) RegisterMiddleware(Middleware) RegisterHeightFeed(<-chan int64) SetBlockWaitDuration(time.Duration) OnMissing(func(*CallContext, string, []json.RawMessage) (interface{}, *RPCError, *CallMetadata)) Disconnect(context.Context) }
func NewRegistry ¶
type RegistryCallable ¶ added in v0.0.7
type RegistryCallable interface {
Call(ctx context.Context, method string, args []json.RawMessage, output chan interface{}, latestNumber int64) (interface{}, *RPCError, *CallMetadata)
}
type Response ¶ added in v0.0.18
type Response struct { Version string `json:"jsonrpc"` ID json.RawMessage `json:"id"` Error *RPCError `json:"error,omitempty"` Result interface{} `json:"result,omitempty"` Params interface{} `json:"params,omitempty"` Meta *CallMetadata `json:"-"` }
type SubscriptionResponse ¶ added in v0.0.19
type SubscriptionResponseRaw ¶ added in v0.0.19
Click to show internal directories.
Click to hide internal directories.