client

package
v0.0.0-...-4e8033b Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2018 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(cfg interface{}, optFuncs ...OptionFunc) error

func MergeInReaders

func MergeInReaders(v *viper.Viper, cfgType string, readers []io.Reader) error

MergeInConfigs merges the viper configs found in several readers into a single one

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(config ClientConfig) (*Client, error)

load config example in unchainio/pkg/xconfig

func (*Client) GetBlock

func (c *Client) GetBlock(blockHeight string) (transaction.Block, error)

func (*Client) GetTransaction

func (c *Client) GetTransaction(transactionID string) (transaction.Transaction, error)

func (*Client) ListBlocks

func (c *Client) ListBlocks(transactionID string) ([]transaction.Block, error)

func (*Client) ListOutputs

func (c *Client) ListOutputs(pubKey string, spent bool) ([]transaction.OutputLocation, error)

func (*Client) ListTransactions

func (c *Client) ListTransactions(assetID, operation string) ([]transaction.Transaction, error)

func (*Client) PostTransaction

func (c *Client) PostTransaction(txn *transaction.Transaction) error

Default transaction mode is async: client immediately receives response from server transaction validity is not checked

func (*Client) PostTransactionCommit

func (c *Client) PostTransactionCommit(txn *transaction.Transaction) error

Client receives a response when transaction is committed to block

func (*Client) PostTransactionSync

func (c *Client) PostTransactionSync(txn *transaction.Transaction) error

Client receives a response when the transaction is valid

func (*Client) SearchAsset

func (c *Client) SearchAsset(search string, limit int) ([]transaction.Asset, error)

TODO add search string to request

func (*Client) SearchMetadata

func (c *Client) SearchMetadata(search string, limit int) ([]transaction.Metadata, error)

TODO add search string to request

type ClientConfig

type ClientConfig struct {
	Url     string            `json:"url"`
	Headers map[string]string `json:"headers"`
}

type OptionFunc

type OptionFunc func(*Options) error

func FromReaders

func FromReaders(cfgType string, readers ...io.Reader) OptionFunc

type Options

type Options struct {
	// contains filtered or unexported fields
}

type TxrOptions

type TxrOptions struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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