Versions in this module Expand all Collapse all v0 v0.0.7 Dec 31, 2021 Changes in this version + const DefaultHTTPTimeout + type BatchLoader struct + func NewBatchLoader(maxBatch int, wait time.Duration) (*BatchLoader, error) + func (l *BatchLoader) Init(p *HTTPProvider) + func (l *BatchLoader) Load(req *jsonrpc2.JSONRPCRequest) ([]byte, error) + func (l *BatchLoader) LoadAll(reqs []*jsonrpc2.JSONRPCRequest) ([][]byte, []error) + func (l *BatchLoader) LoadAllThunk(keys []*jsonrpc2.JSONRPCRequest) func() ([][]byte, []error) + func (l *BatchLoader) LoadThunk(req *jsonrpc2.JSONRPCRequest) func() ([]byte, error) + type HTTPProvider struct + func New(url string) (*HTTPProvider, error) + func NewWithLoader(url string, loader RPCLoader) (*HTTPProvider, error) + func (p *HTTPProvider) Call(result interface{}, method string, params ...interface{}) error + func (p *HTTPProvider) CallRaw(method string, params ...interface{}) ([]byte, error) + func (p *HTTPProvider) SetHTTPClient(httpClient *http.Client) + func (p *HTTPProvider) SetHTTPTimeout(httpTimeout time.Duration) + func (p *HTTPProvider) Start() error + func (p *HTTPProvider) Stop() + func (p *HTTPProvider) Subscribe(receiver chan *json.RawMessage, method string, event string, ...) error + type RPCLoader interface + Init func(p *HTTPProvider) + Load func(*jsonrpc2.JSONRPCRequest) ([]byte, error) + type SyncLoader struct + func NewSyncLoader() (*SyncLoader, error) + func (l *SyncLoader) Init(p *HTTPProvider) + func (l *SyncLoader) Load(req *jsonrpc2.JSONRPCRequest) ([]byte, error)