Documentation ¶
Index ¶
- type HTTPClient
- func (c *HTTPClient) AddDisconnectHandler(onDisconnect rpcinterface.DisconnectHandler)
- func (c *HTTPClient) AddHandler(handler rpcinterface.WebsocketResponseHandler) (uuid.UUID, error)
- func (c *HTTPClient) AddReconnectHandler(onReconnect rpcinterface.ReconnectHandler)
- func (c *HTTPClient) Close() error
- func (c *HTTPClient) Do(req *rpcinterface.Request, v rpcinterface.IResponse) (*http.Response, error)
- func (c *HTTPClient) NewRequest(service rpcinterface.ServiceType, rpcEndpoint rpcinterface.Endpoint, ...) (*rpcinterface.Request, error)
- func (c *HTTPClient) RemoveHandler(handlerID uuid.UUID)
- func (c *HTTPClient) SetAsyncMode()
- func (c *HTTPClient) SetBaseURL(url *url.URL) error
- func (c *HTTPClient) SetCacheValidTime(validTime time.Duration)
- func (c *HTTPClient) SetLogHandler(handler slog.Handler)
- func (c *HTTPClient) SetSyncMode()
- 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 HTTPClient ¶
type HTTPClient struct { // Request timeout Timeout time.Duration // contains filtered or unexported fields }
HTTPClient connects to Chia RPC via standard HTTP requests
func NewHTTPClient ¶
func NewHTTPClient(options ...rpcinterface.ClientOptionFunc) (*HTTPClient, error)
NewHTTPClient returns a new HTTP client that satisfies the rpcinterface.Client interface for use with public RPC services
func (*HTTPClient) AddDisconnectHandler ¶
func (c *HTTPClient) AddDisconnectHandler(onDisconnect rpcinterface.DisconnectHandler)
AddDisconnectHandler does not apply to the HTTP Client
func (*HTTPClient) AddHandler ¶
func (c *HTTPClient) AddHandler(handler rpcinterface.WebsocketResponseHandler) (uuid.UUID, error)
AddHandler does not apply to HTTP Client
func (*HTTPClient) AddReconnectHandler ¶
func (c *HTTPClient) AddReconnectHandler(onReconnect rpcinterface.ReconnectHandler)
AddReconnectHandler does not apply to the HTTP Client
func (*HTTPClient) Close ¶ added in v0.17.0
func (c *HTTPClient) Close() error
Close closes the connection. Not applicable for the HTTPClient, so just returns no error
func (*HTTPClient) Do ¶
func (c *HTTPClient) Do(req *rpcinterface.Request, v rpcinterface.IResponse) (*http.Response, error)
Do sends an RPC request and returns the RPC response.
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) RemoveHandler ¶
func (c *HTTPClient) RemoveHandler(handlerID uuid.UUID)
RemoveHandler does not apply to HTTP Client
func (*HTTPClient) SetAsyncMode ¶
func (c *HTTPClient) SetAsyncMode()
SetAsyncMode does not apply to the HTTP Client
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) SetLogHandler ¶
func (c *HTTPClient) SetLogHandler(handler slog.Handler)
SetLogHandler sets a slog compatible log handler
func (*HTTPClient) SetSyncMode ¶
func (c *HTTPClient) SetSyncMode()
SetSyncMode does not apply to the HTTP Client
func (*HTTPClient) Subscribe ¶
func (c *HTTPClient) Subscribe(service string) error
Subscribe does not apply to the HTTP Client Not applicable on the HTTP connection
func (*HTTPClient) SubscribeSelf ¶
func (c *HTTPClient) SubscribeSelf() error
SubscribeSelf does not apply to the HTTP Client