Documentation ¶
Index ¶
- Constants
- func StartClient(address string, endpoint string) (client.Client, error)
- type RobustClient
- func (r *RobustClient) BlockResults(ctx context.Context, height *int64) (results *coretypes.ResultBlockResults, err error)
- func (r *RobustClient) LatestSyncInfo(ctx context.Context) (*coretypes.SyncInfo, error)
- func (r *RobustClient) Stop() error
- func (r *RobustClient) Subscribe(ctx context.Context, subscriber, query string, outCapacity ...int) (out <-chan coretypes.ResultEvent, err error)
- func (r *RobustClient) Unsubscribe(ctx context.Context, subscriber, query string) error
Constants ¶
View Source
const ( DefaultWSEndpoint = "/websocket" DefaultAddress = "http://localhost:26657" )
default client parameters
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RobustClient ¶
type RobustClient struct {
// contains filtered or unexported fields
}
RobustClient is a client that recreates the server connection of a connection failure occurs
func NewRobustClient ¶
func NewRobustClient(factory func() (client.Client, error)) *RobustClient
NewRobustClient returns a new RobustClient instance
func (*RobustClient) BlockResults ¶
func (r *RobustClient) BlockResults(ctx context.Context, height *int64) (results *coretypes.ResultBlockResults, err error)
BlockResults returns the all results of the block of given height
func (*RobustClient) LatestSyncInfo ¶
LatestSyncInfo returns the sync info of the node
func (*RobustClient) Stop ¶
func (r *RobustClient) Stop() error
Stop stops the client and closes the server connection
func (*RobustClient) Subscribe ¶
func (r *RobustClient) Subscribe(ctx context.Context, subscriber, query string, outCapacity ...int) (out <-chan coretypes.ResultEvent, err error)
Subscribe subscribes to the given query
func (*RobustClient) Unsubscribe ¶
func (r *RobustClient) Unsubscribe(ctx context.Context, subscriber, query string) error
Unsubscribe unsubsribes the given query, if a subscription exists
Click to show internal directories.
Click to hide internal directories.