http

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2024 License: MIT Imports: 22 Imported by: 2

Documentation

Overview

package http implements an http transport for the Kwil txsvc client.

Index

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) ChainInfo

func (c *Client) ChainInfo(ctx context.Context) (*types.ChainInfo, error)

func (*Client) EstimateCost

func (c *Client) EstimateCost(ctx context.Context, tx *transactions.Transaction) (*big.Int, error)

func (*Client) GetAccount

func (c *Client) GetAccount(ctx context.Context, pubKey []byte, status types.AccountStatus) (*types.Account, error)

func (*Client) GetSchema

func (c *Client) GetSchema(ctx context.Context, dbid string) (*transactions.Schema, error)

func (*Client) ListDatabases

func (c *Client) ListDatabases(ctx context.Context, ownerPubKey []byte) ([]*types.DatasetIdentifier, error)

func (*Client) Ping

func (c *Client) Ping(ctx context.Context) (string, error)

func (*Client) Query

func (c *Client) Query(ctx context.Context, dbid string, query string) ([]map[string]any, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL