Documentation ¶
Overview ¶
package http implements an http transport for the Kwil txsvc client.
Index ¶
- type Client
- func (c *Client) Broadcast(ctx context.Context, tx *transactions.Transaction, sync client.BroadcastWait) ([]byte, error)
- func (c *Client) Call(ctx context.Context, msg *transactions.CallMessage, ...) ([]map[string]any, error)
- func (c *Client) ChainInfo(ctx context.Context) (*types.ChainInfo, error)
- func (c *Client) EstimateCost(ctx context.Context, tx *transactions.Transaction) (*big.Int, error)
- func (c *Client) GetAccount(ctx context.Context, pubKey []byte, status types.AccountStatus) (*types.Account, error)
- func (c *Client) GetSchema(ctx context.Context, dbid string) (*transactions.Schema, error)
- func (c *Client) ListDatabases(ctx context.Context, ownerPubKey []byte) ([]*types.DatasetIdentifier, error)
- func (c *Client) Ping(ctx context.Context) (string, error)
- func (c *Client) Query(ctx context.Context, dbid string, query string) ([]map[string]any, error)
- func (c *Client) TxQuery(ctx context.Context, txHash []byte) (*transactions.TcTxQueryResponse, error)
- type ClientOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(target *url.URL, opts ...ClientOption) *Client
NewClient creates a new http client for the Kwil user service
func (*Client) Broadcast ¶
func (c *Client) Broadcast(ctx context.Context, tx *transactions.Transaction, sync client.BroadcastWait) ([]byte, error)
func (*Client) Call ¶
func (c *Client) Call(ctx context.Context, msg *transactions.CallMessage, opts ...client.ActionCallOption) ([]map[string]any, error)
func (*Client) EstimateCost ¶
func (c *Client) EstimateCost(ctx context.Context, tx *transactions.Transaction) (*big.Int, error)
func (*Client) GetAccount ¶
func (*Client) ListDatabases ¶
func (*Client) TxQuery ¶
func (c *Client) TxQuery(ctx context.Context, txHash []byte) (*transactions.TcTxQueryResponse, error)
type ClientOption ¶
type ClientOption func(*clientOptions)
func WithHTTPClient ¶
func WithHTTPClient(client *http.Client) ClientOption
WithHTTPClient sets the http client for the client. This allows custom http clients to be used.
Click to show internal directories.
Click to hide internal directories.