Versions in this module Expand all Collapse all v1 v1.1.3 Feb 13, 2020 Changes in this version + const EarliestBlockNumber + const LatestBlockNumber + const MetadataApi + const PendingBlockNumber + var ErrClientQuit = errors.New("client is closed") + var ErrNoResult = errors.New("no result in JSON-RPC response") + var ErrNotificationsUnsupported = errors.New("notifications not supported") + var ErrSubscriptionNotFound = errors.New("subscription not found") + var ErrSubscriptionQueueOverflow = errors.New("subscription queue overflow") + func NewHTTPServer(cors []string, vhosts []string, srv *Server) *http.Server + func NewWSServer(allowedOrigins []string, srv *Server) *http.Server + type API struct + Namespace string + Public bool + Service interface{} + Version string + type BatchElem struct + Args []interface{} + Error error + Method string + Result interface{} + type BlockNumber int64 + func (bn *BlockNumber) UnmarshalJSON(data []byte) error + func (bn BlockNumber) Int64() int64 + type Client struct + func Dial(rawurl string) (*Client, error) + func DialContext(ctx context.Context, rawurl string) (*Client, error) + func DialHTTP(endpoint string) (*Client, error) + func DialHTTPWithClient(endpoint string, client *http.Client) (*Client, error) + func DialIPC(ctx context.Context, endpoint string) (*Client, error) + func DialInProc(handler *Server) *Client + func DialStdIO(ctx context.Context) (*Client, error) + func DialWebsocket(ctx context.Context, endpoint, origin string) (*Client, error) + func (c *Client) BatchCall(b []BatchElem) error + func (c *Client) BatchCallContext(ctx context.Context, b []BatchElem) error + func (c *Client) Call(result interface{}, method string, args ...interface{}) error + func (c *Client) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error + func (c *Client) Close() + func (c *Client) EthSubscribe(ctx context.Context, channel interface{}, args ...interface{}) (*ClientSubscription, error) + func (c *Client) ShhSubscribe(ctx context.Context, channel interface{}, args ...interface{}) (*ClientSubscription, error) + func (c *Client) Subscribe(ctx context.Context, namespace string, channel interface{}, ...) (*ClientSubscription, error) + func (c *Client) SupportedModules() (map[string]string, error) + type ClientSubscription struct + func (sub *ClientSubscription) Err() <-chan error + func (sub *ClientSubscription) Unsubscribe() + type CodecOption int + const OptionMethodInvocation + const OptionSubscriptions + type Error interface + Error func() string + ErrorCode func() int + type HexNumber big.Int + func NewHexNumber(val interface{}) *HexNumber + func (h *HexNumber) BigInt() *big.Int + func (h *HexNumber) Int() int + func (h *HexNumber) Int64() int64 + func (h *HexNumber) MarshalJSON() ([]byte, error) + func (h *HexNumber) Uint() uint + func (h *HexNumber) Uint64() uint64 + func (h *HexNumber) UnmarshalJSON(input []byte) error + type ID string + func NewID() ID + type Notifier struct + func NotifierFromContext(ctx context.Context) (*Notifier, bool) + func (n *Notifier) Closed() <-chan interface{} + func (n *Notifier) CreateSubscription() *Subscription + func (n *Notifier) Notify(id ID, data interface{}) error + type RPCService struct + func (s *RPCService) Modules() map[string]string + type Server struct + func NewServer() *Server + func StartHTTPEndpoint(endpoint string, apis []API, modules []string, cors []string, vhosts []string) (net.Listener, *Server, error) + func StartIPCEndpoint(ipcEndpoint string, apis []API) (net.Listener, *Server, error) + func StartWSEndpoint(endpoint string, apis []API, modules []string, wsOrigins []string, ...) (net.Listener, *Server, error) + func (s *Server) RegisterName(name string, rcvr interface{}) error + func (s *Server) ServeCodec(codec ServerCodec, options CodecOption) + func (s *Server) ServeSingleRequest(ctx context.Context, codec ServerCodec, options CodecOption) + func (s *Server) Stop() + func (srv *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (srv *Server) ServeListener(l net.Listener) error + func (srv *Server) WebsocketHandler(allowedOrigins []string) http.Handler + type ServerCodec interface + Close func() + Closed func() <-chan interface{} + CreateErrorResponse func(id interface{}, err Error) interface{} + CreateErrorResponseWithInfo func(id interface{}, err Error, info interface{}) interface{} + CreateNotification func(id, namespace string, event interface{}) interface{} + CreateResponse func(id interface{}, reply interface{}) interface{} + ParseRequestArguments func(argTypes []reflect.Type, params interface{}) ([]reflect.Value, Error) + ReadRequestHeaders func() ([]rpcRequest, bool, Error) + Write func(msg interface{}) error + func NewCodec(rwc io.ReadWriteCloser, encode, decode func(v interface{}) error) ServerCodec + func NewJSONCodec(rwc io.ReadWriteCloser) ServerCodec + type StdIOConn struct + func (io StdIOConn) Close() error + func (io StdIOConn) LocalAddr() net.Addr + func (io StdIOConn) Read(b []byte) (n int, err error) + func (io StdIOConn) RemoteAddr() net.Addr + func (io StdIOConn) SetDeadline(t time.Time) error + func (io StdIOConn) SetReadDeadline(t time.Time) error + func (io StdIOConn) SetWriteDeadline(t time.Time) error + func (io StdIOConn) Write(b []byte) (n int, err error) + type Subscription struct + ID ID + func (s *Subscription) Err() <-chan error