Documentation ¶
Index ¶
- func DialContext(ctx Context) (*types.NubitClient, error)
- func DialHTTP(ctx Context) (*types.NubitClient, error)
- func DialHTTPWithClient(ctx Context) (*types.NubitClient, error)
- type Client
- func (c *Client) CountDatasize(ctx context.Context) (data *types2.CountRsp, err error)
- func (c *Client) CountNamespace(ctx context.Context) (data *types.CountRsp, err error)
- func (c *Client) CountTransactions(ctx context.Context) (data *types.CountRsp, err error)
- func (c *Client) CountUsers(ctx context.Context) (data *types.CountRsp, err error)
- func (c *Client) CreateNamespace(ctx context.Context, req *types.CreateNameSpaceReq, ...) (data *types.DataUploadRsp, err error)
- func (c *Client) GetBlockHeaderByNumber(ctx context.Context, req *types.GetBlockHeaderByNumberReq) (data *types.GetBlockHeaderByNumberRsp, err error)
- func (c *Client) GetDAIDByTxID(ctx context.Context, req *types2.QueryTxReq) (data *types2.GetDAIDRsp, err error)
- func (c *Client) GetData(ctx context.Context, req *types2.GetDataReq) (data *types2.GetDataRsp, err error)
- func (c *Client) GetDataByDAID(ctx context.Context, req *types2.GetDataReq) (data *types2.GetDataCallRsp, err error)
- func (c *Client) GetDataIDByUser(ctx context.Context, req *types2.GetDataByUserReq) (data *types2.GetDataByUserRsp, err error)
- func (c *Client) GetDataInNamespace(ctx context.Context, req *types.GetDataInNamespaceReq) (data *types.GetDataInNamespaceRsp, err error)
- func (c *Client) GetDataStatus(ctx context.Context, req *types2.GetDataStatusReq) (data *types2.GetDataStatusRsp, err error)
- func (c *Client) GetDatas(ctx context.Context, req *types.GetDatasReq) (data *types.GetDatasRsp, err error)
- func (c *Client) GetEstimateFee(ctx context.Context, req any, privateKey *ecdsa.PrivateKey, method string, ...) (data *types2.EstimateFee, err error)
- func (c *Client) GetInvoice(ctx context.Context, req *types.GetInvoiceReq) (data *types.Invoice, err error)
- func (c *Client) GetLastNamespaceID(ctx context.Context, req *types.GetLastNamespaceIDReq) (data *types.GetLastNamespaceIDRsp, err error)
- func (c *Client) GetLatestBlockNumber(ctx context.Context) (data *types.GetLatestBlockNumberRsp, err error)
- func (c *Client) GetNIDByTxID(ctx context.Context, req *types.QueryTxReq) (data *types.GetNIDRsp, err error)
- func (c *Client) GetNamespace(ctx context.Context, req *types.GetNamespaceReq) (data *types.GetNamespaceRsp, err error)
- func (c *Client) GetNamespaceByUser(ctx context.Context, req *types.GetNamespaceByUserReq) (data *types.GetNamespaceByUserRsp, err error)
- func (c *Client) GetNamespaceStatus(ctx context.Context, req *types.GetNamespaceStatusReq) (data *types.GetNamespaceStatusRsp, err error)
- func (c *Client) GetNamespaces(ctx context.Context, req *types.GetNamespacesReq) (data *types.GetNamespacesRsp, err error)
- func (c *Client) GetNonce(ctx context.Context, req *types.GetNonceReq) (data *types.GetNonceRsp, err error)
- func (c *Client) GetPayee(ctx context.Context) (data *types.Payee, err error)
- func (c *Client) GetTotalDataIDsInNamesapce(ctx context.Context, req *types.GetTotalDataIDsInNamesapceReq) (data *types.GetTotalDataIDsInNamesapceRsp, err error)
- func (c *Client) GetTransaction(ctx context.Context, req *types.GetTransactionReq) (data *types.GetTransactionRsp, err error)
- func (c *Client) GetTransactions(ctx context.Context, req *types.GetTransactionsReq) (data *types.GetTransactionsRsp, err error)
- func (c *Client) GetTxIDByDataID(ctx context.Context, req *types.GetTransactionsReq) (data *types.GetTransactionsRsp, err error)
- func (c *Client) SubmitTransaction(ctx context.Context, req *types.TxReq) (data *types.TxRsp, err error)
- func (c *Client) TransferNamespace(ctx context.Context, req *types.TransferNamespaceReq, ...) (data *types.DataUploadRsp, err error)
- func (c *Client) UpdateNamespace(ctx context.Context, req *types.UpdateNamespaceReq, ...) (data *types.DataUploadRsp, err error)
- func (c *Client) Upload(ctx context.Context, data *types2.DataUploadReq, privateKey *ecdsa.PrivateKey, ...) (target *types2.DataUploadRsp, err error)
- type ClientOption
- func WithBatchItemLimit(limit int) ClientOption
- func WithBatchResponseSizeLimit(sizeLimit int) ClientOption
- func WithHTTPAuth(a HTTPAuth) ClientOption
- func WithHTTPClient(c *http.Client) ClientOption
- func WithHeader(key, value string) ClientOption
- func WithHeaders(headers http.Header) ClientOption
- func WithWebsocketDialer(dialer websocket.Dialer) ClientOption
- func WithWebsocketMessageSizeLimit(messageSizeLimit int64) ClientOption
- type Context
- type HTTPAuth
- type ID
- type Uri
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialContext ¶
func DialContext(ctx Context) (*types.NubitClient, error)
DialContext creates a new RPC client, just like Dial.
The context is used to cancel or time out the initial connection establishment. It does not affect subsequent interactions with the client.
func DialHTTP ¶
func DialHTTP(ctx Context) (*types.NubitClient, error)
DialHTTP creates a new RPC client that connects to an RPC server over HTTP.
func DialHTTPWithClient ¶
func DialHTTPWithClient(ctx Context) (*types.NubitClient, error)
DialHTTPWithClient creates a new RPC client that connects to an RPC server over HTTP using the provided HTTP Client.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CountDatasize ¶
CountDatasize indexer-countDatasize
func (*Client) CountNamespace ¶
CountNamespace indexer-countNamespace
func (*Client) CountTransactions ¶
CountTransactions indexer-countTransactions
func (*Client) CountUsers ¶
CountUsers indexer-countUsers
func (*Client) CreateNamespace ¶
func (c *Client) CreateNamespace(ctx context.Context, req *types.CreateNameSpaceReq, privateKey *ecdsa.PrivateKey, payParams *types.PaymentParams) (data *types.DataUploadRsp, err error)
func (*Client) GetBlockHeaderByNumber ¶
func (c *Client) GetBlockHeaderByNumber(ctx context.Context, req *types.GetBlockHeaderByNumberReq) (data *types.GetBlockHeaderByNumberRsp, err error)
func (*Client) GetDAIDByTxID ¶
func (c *Client) GetDAIDByTxID(ctx context.Context, req *types2.QueryTxReq) (data *types2.GetDAIDRsp, err error)
func (*Client) GetData ¶
func (c *Client) GetData(ctx context.Context, req *types2.GetDataReq) (data *types2.GetDataRsp, err error)
func (*Client) GetDataByDAID ¶
func (c *Client) GetDataByDAID(ctx context.Context, req *types2.GetDataReq) (data *types2.GetDataCallRsp, err error)
func (*Client) GetDataIDByUser ¶
func (c *Client) GetDataIDByUser(ctx context.Context, req *types2.GetDataByUserReq) (data *types2.GetDataByUserRsp, err error)
func (*Client) GetDataInNamespace ¶
func (c *Client) GetDataInNamespace(ctx context.Context, req *types.GetDataInNamespaceReq) (data *types.GetDataInNamespaceRsp, err error)
func (*Client) GetDataStatus ¶
func (c *Client) GetDataStatus(ctx context.Context, req *types2.GetDataStatusReq) (data *types2.GetDataStatusRsp, err error)
func (*Client) GetDatas ¶
func (c *Client) GetDatas(ctx context.Context, req *types.GetDatasReq) (data *types.GetDatasRsp, err error)
func (*Client) GetEstimateFee ¶
func (*Client) GetInvoice ¶
func (*Client) GetLastNamespaceID ¶
func (c *Client) GetLastNamespaceID(ctx context.Context, req *types.GetLastNamespaceIDReq) (data *types.GetLastNamespaceIDRsp, err error)
func (*Client) GetLatestBlockNumber ¶
func (*Client) GetNIDByTxID ¶
func (*Client) GetNamespace ¶
func (c *Client) GetNamespace(ctx context.Context, req *types.GetNamespaceReq) (data *types.GetNamespaceRsp, err error)
func (*Client) GetNamespaceByUser ¶
func (c *Client) GetNamespaceByUser(ctx context.Context, req *types.GetNamespaceByUserReq) (data *types.GetNamespaceByUserRsp, err error)
GetNamespaceByUser Deprecated: use GetTransactions instead.
func (*Client) GetNamespaceStatus ¶
func (c *Client) GetNamespaceStatus(ctx context.Context, req *types.GetNamespaceStatusReq) (data *types.GetNamespaceStatusRsp, err error)
func (*Client) GetNamespaces ¶
func (c *Client) GetNamespaces(ctx context.Context, req *types.GetNamespacesReq) (data *types.GetNamespacesRsp, err error)
GetNamespaces indexer-getNamespaces
func (*Client) GetNonce ¶
func (c *Client) GetNonce(ctx context.Context, req *types.GetNonceReq) (data *types.GetNonceRsp, err error)
func (*Client) GetTotalDataIDsInNamesapce ¶
func (c *Client) GetTotalDataIDsInNamesapce(ctx context.Context, req *types.GetTotalDataIDsInNamesapceReq) (data *types.GetTotalDataIDsInNamesapceRsp, err error)
func (*Client) GetTransaction ¶
func (c *Client) GetTransaction(ctx context.Context, req *types.GetTransactionReq) (data *types.GetTransactionRsp, err error)
func (*Client) GetTransactions ¶
func (c *Client) GetTransactions(ctx context.Context, req *types.GetTransactionsReq) (data *types.GetTransactionsRsp, err error)
GetTransactions indexer-getTransactions
func (*Client) GetTxIDByDataID ¶
func (c *Client) GetTxIDByDataID(ctx context.Context, req *types.GetTransactionsReq) (data *types.GetTransactionsRsp, err error)
GetTxIDByDataID indexer-getTxIDByDataID
func (*Client) SubmitTransaction ¶
func (*Client) TransferNamespace ¶
func (c *Client) TransferNamespace(ctx context.Context, req *types.TransferNamespaceReq, privateKey *ecdsa.PrivateKey, payParams *types.PaymentParams) (data *types.DataUploadRsp, err error)
func (*Client) UpdateNamespace ¶
func (c *Client) UpdateNamespace(ctx context.Context, req *types.UpdateNamespaceReq, privateKey *ecdsa.PrivateKey, payParams *types.PaymentParams) (data *types.DataUploadRsp, err error)
func (*Client) Upload ¶
func (c *Client) Upload(ctx context.Context, data *types2.DataUploadReq, privateKey *ecdsa.PrivateKey, payParams *types2.PaymentParams) (target *types2.DataUploadRsp, err error)
type ClientOption ¶
type ClientOption interface {
// contains filtered or unexported methods
}
ClientOption is a configuration option for the RPC client.
func WithBatchItemLimit ¶
func WithBatchItemLimit(limit int) ClientOption
WithBatchItemLimit changes the maximum number of items allowed in batch requests.
Note: this option applies when processing incoming batch requests. It does not affect batch requests sent by the client.
func WithBatchResponseSizeLimit ¶
func WithBatchResponseSizeLimit(sizeLimit int) ClientOption
WithBatchResponseSizeLimit changes the maximum number of response bytes that can be generated for batch requests. When this limit is reached, further calls in the batch will not be processed.
Note: this option applies when processing incoming batch requests. It does not affect batch requests sent by the client.
func WithHTTPAuth ¶
func WithHTTPAuth(a HTTPAuth) ClientOption
WithHTTPAuth configures HTTP request authentication. The given provider will be called whenever a request is made. Note that only one authentication provider can be active at any time.
func WithHTTPClient ¶
func WithHTTPClient(c *http.Client) ClientOption
WithHTTPClient configures the http.Client used by the RPC client.
func WithHeader ¶
func WithHeader(key, value string) ClientOption
WithHeader configures HTTP headers set by the RPC client. Headers set using this option will be used for both HTTP and WebSocket connections.
func WithHeaders ¶
func WithHeaders(headers http.Header) ClientOption
WithHeaders configures HTTP headers set by the RPC client. Headers set using this option will be used for both HTTP and WebSocket connections.
func WithWebsocketDialer ¶
func WithWebsocketDialer(dialer websocket.Dialer) ClientOption
WithWebsocketDialer configures the websocket.Dialer used by the RPC client.
func WithWebsocketMessageSizeLimit ¶
func WithWebsocketMessageSizeLimit(messageSizeLimit int64) ClientOption
WithWebsocketMessageSizeLimit configures the websocket message size limit used by the RPC client. Passing a limit of 0 means no limit.
type HTTPAuth ¶
A HTTPAuth function is called by the client whenever a HTTP request is sent. The function must be safe for concurrent use.
Usually, HTTPAuth functions will call h.Set("authorization", "...") to add auth information to the request.