client

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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

func NewAPI

func NewAPI(endpoint string, key *crypto.Key, accountID string) API

NewAPI constructs a new API instances based on an http transport

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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