Documentation ¶
Index ¶
- type CachedTransport
- type HTTPClient
- func (c *HTTPClient) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
- func (c *HTTPClient) ListenSync(handler rpcinterface.WebsocketResponseHandler) error
- func (c *HTTPClient) NewRequest(service rpcinterface.ServiceType, rpcEndpoint rpcinterface.Endpoint, ...) (*rpcinterface.Request, error)
- func (c *HTTPClient) SetBaseURL(url *url.URL) error
- func (c *HTTPClient) SetCacheValidTime(validTime time.Duration)
- func (c *HTTPClient) Subscribe(service string) error
- func (c *HTTPClient) SubscribeSelf() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachedTransport ¶
type CachedTransport struct {
// contains filtered or unexported fields
}
CachedTransport is an http transport with cache on top
func NewCachedTransport ¶
func NewCachedTransport(expiration time.Duration, transport http.RoundTripper) *CachedTransport
NewCachedTransport returns a new transport wrapped in cache
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient connects to Chia RPC via standard HTTP requests
func NewHTTPClient ¶
func NewHTTPClient(cfg *config.ChiaConfig, options ...rpcinterface.ClientOptionFunc) (*HTTPClient, error)
NewHTTPClient returns a new HTTP client that satisfies the rpcinterface.Client interface
func (*HTTPClient) Do ¶
func (c *HTTPClient) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error)
Do sends an RPC request and returns the RPC response.
func (*HTTPClient) ListenSync ¶
func (c *HTTPClient) ListenSync(handler rpcinterface.WebsocketResponseHandler) error
ListenSync Listens for async responses over the connection in a synchronous fashion, blocking anything else Not applicable on the HTTP connection
func (*HTTPClient) NewRequest ¶
func (c *HTTPClient) NewRequest(service rpcinterface.ServiceType, rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error)
NewRequest creates an RPC request for the specified service
func (*HTTPClient) SetBaseURL ¶
func (c *HTTPClient) SetBaseURL(url *url.URL) error
SetBaseURL sets the base URL for API requests to a custom endpoint.
func (*HTTPClient) SetCacheValidTime ¶
func (c *HTTPClient) SetCacheValidTime(validTime time.Duration)
SetCacheValidTime sets how long cache should be valid for
func (*HTTPClient) Subscribe ¶
func (c *HTTPClient) Subscribe(service string) error
Subscribe adds a subscription to events from a particular service Not applicable on the HTTP connection
func (*HTTPClient) SubscribeSelf ¶
func (c *HTTPClient) SubscribeSelf() error
SubscribeSelf subscribes to events in response to requests from this service Not applicable on the HTTP connection