Documentation
¶
Index ¶
- type API
- type AccountAPI
- type BaseClient
- func (c *BaseClient) AddAccount(acc *state.Account) error
- func (c *BaseClient) AddPayload(cv *state.Payload) error
- func (c *BaseClient) GetAccount(id string) (*state.Account, error)
- func (c *BaseClient) GetPayload(id string) (*state.Payload, error)
- func (c *BaseClient) ListAccounts() ([]state.Account, error)
- func (c *BaseClient) ListPayloads() ([]state.Payload, error)
- func (c *BaseClient) SearchAccounts(searchQuery []byte) ([]state.Account, error)
- func (c *BaseClient) SearchPayloads(searchQuery []byte) ([]state.Payload, error)
- type FastClient
- type PayloadAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { AccountAPI PayloadAPI }
API is the high level interface for Anychaindb client applications
type AccountAPI ¶
type AccountAPI interface { CreateAccount() (id, pub, priv string, err error) GetAccount(id string) (*state.Account, error) ListAccounts() ([]state.Account, error) SearchAccounts(query []byte) ([]state.Account, error) }
AccountAPI describes all account related functions
type BaseClient ¶
type BaseClient struct { Key *crypto.Key AccountID string // contains filtered or unexported fields }
func NewHTTPClient ¶
func NewHTTPClient(endpoint string, key *crypto.Key, accountID string) *BaseClient
func (*BaseClient) AddAccount ¶
func (c *BaseClient) AddAccount(acc *state.Account) error
func (*BaseClient) AddPayload ¶
func (c *BaseClient) AddPayload(cv *state.Payload) error
func (*BaseClient) GetAccount ¶
func (c *BaseClient) GetAccount(id string) (*state.Account, error)
func (*BaseClient) GetPayload ¶
func (c *BaseClient) GetPayload(id string) (*state.Payload, error)
func (*BaseClient) ListAccounts ¶
func (c *BaseClient) ListAccounts() ([]state.Account, error)
func (*BaseClient) ListPayloads ¶
func (c *BaseClient) ListPayloads() ([]state.Payload, error)
func (*BaseClient) SearchAccounts ¶ added in v1.2.0
func (c *BaseClient) SearchAccounts(searchQuery []byte) ([]state.Account, error)
func (*BaseClient) SearchPayloads ¶
func (c *BaseClient) SearchPayloads(searchQuery []byte) ([]state.Payload, error)
type FastClient ¶
type FastClient struct { Endpoint string Key *crypto.Key AccountID string // contains filtered or unexported fields }
func NewFastClient ¶
func NewFastClient(endpoint string, key *crypto.Key, accountID string) *FastClient
func (*FastClient) AddAccount ¶
func (c *FastClient) AddAccount(acc *state.Account) error
func (*FastClient) AddPayload ¶
func (c *FastClient) AddPayload(data *state.Payload) error
func (*FastClient) BroadcastTxAsync ¶
func (c *FastClient) BroadcastTxAsync(tx []byte) (*http.Response, error)
type PayloadAPI ¶
type PayloadAPI interface { AddPayload(senderAccountID, receiverAccountID string, publicData, privateData []byte) (ID string, err error) GetPayload(ID string) (*state.Payload, error) ListPayloads() ([]state.Payload, error) SearchPayloads(query []byte) ([]state.Payload, error) }
PayloadAPI interface provides all transaction data related methods
Click to show internal directories.
Click to hide internal directories.