client

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ABCIKeyQuery

func ABCIKeyQuery(ctx context.Context, c BnsClient, path string, data []byte, destination *models.KeyModel) error

Types

type ABCIIterator

type ABCIIterator interface {
	Next(orm.Model) ([]byte, error)
}

func ABCIFullRangeQuery

func ABCIFullRangeQuery(ctx context.Context, bns BnsClient, path, data string) ABCIIterator

func ABCIKeyQueryIter added in v0.21.4

func ABCIKeyQueryIter(ctx context.Context, c BnsClient, path string, data []byte) ABCIIterator

func ABCIPrefixQuery added in v0.21.4

func ABCIPrefixQuery(ctx context.Context, c BnsClient, path string, prefix []byte) ABCIIterator

func ABCIRangeQuery

func ABCIRangeQuery(ctx context.Context, c BnsClient, path string, data string) ABCIIterator

type BnsClient

type BnsClient interface {
	Get(ctx context.Context, path string, dest interface{}) error
	Post(ctx context.Context, data []byte, dest interface{}) error
}

BnsClient is implemented by any service that provides access to BNS API.

type HTTPBnsClient

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

HTTPBnsClient implements BnsClient interface and it is using HTTP transport to communicate with BNS instance.

func NewHTTPBnsClient

func NewHTTPBnsClient(apiURL string) *HTTPBnsClient

NewHTTPBnsClient returns an instance of a BnsClient that is using HTTP transport.

func (*HTTPBnsClient) Get

func (c *HTTPBnsClient) Get(ctx context.Context, path string, dest interface{}) error

func (*HTTPBnsClient) Post

func (c *HTTPBnsClient) Post(ctx context.Context, data []byte, dest interface{}) error

Jump to

Keyboard shortcuts

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