Documentation ¶
Overview ¶
package grpc implements a gRPC client for the Kwil txsvc client.
Index ¶
- func CreateCertOption(certFile string) (grpc.DialOption, error)
- type Client
- func (c *Client) Broadcast(ctx context.Context, tx *transactions.Transaction, ...) ([]byte, error)
- func (c *Client) Call(ctx context.Context, req *transactions.CallMessage, ...) ([]map[string]any, error)
- func (c *Client) ChainInfo(ctx context.Context) (*types.ChainInfo, error)
- func (c *Client) Close() error
- func (c *Client) EstimateCost(ctx context.Context, tx *transactions.Transaction) (*big.Int, error)
- func (c *Client) GetAccount(ctx context.Context, identifier []byte, status types.AccountStatus) (*types.Account, error)
- func (c *Client) GetConfig(ctx context.Context) (*SvcConfig, error)
- func (c *Client) GetSchema(ctx context.Context, dbid string) (*transactions.Schema, error)
- func (c *Client) GetTarget() string
- func (c *Client) ListDatabases(ctx context.Context, ownerIdentifier []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 Option
- type SvcConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCertOption ¶
func CreateCertOption(certFile string) (grpc.DialOption, error)
CreateCertOption returns a grpc.DialOption that can be used to create a secure connection to the given certFile. If certFile is empty, the connection will be insecure.
Types ¶
type Client ¶
type Client struct { TxClient txpb.TxServiceClient // contains filtered or unexported fields }
func WrapConn ¶
func WrapConn(conn *grpc.ClientConn) *Client
WrapConn wraps an existing grpc.ClientConn with the TxServiceClient.
func (*Client) Broadcast ¶
func (c *Client) Broadcast(ctx context.Context, tx *transactions.Transaction, sync rpcClient.BroadcastWait) ([]byte, error)
func (*Client) Call ¶
func (c *Client) Call(ctx context.Context, req *transactions.CallMessage, _ ...rpcClient.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 Option ¶
func WithDialOptions ¶
func WithDialOptions(opts ...grpc.DialOption) Option
func WithTlsCert ¶
Click to show internal directories.
Click to hide internal directories.