client

package
v0.0.0-...-dab54ce Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2017 License: LGPL-3.0 Imports: 11 Imported by: 1

Documentation

Overview

Package client provides SporeDB API client.

It can be used by external applications willing to communicate with a single SporeDB node. The API client is able to get current state of one node's database, and submit transactions to the whole SporeDB cluster.

Please note that the API is under development and is subject to change.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Addr    string
	Timeout time.Duration
	// contains filtered or unexported fields
}

Client is the GRPC SporeDB client.

func (*Client) CLI

func (c *Client) CLI()

CLI starts a command line interface to dial with the GRPC server (debug and maintenance).

func (*Client) Close

func (c *Client) Close()

Close closes the GRPC connection to the server.

func (*Client) Connect

func (c *Client) Connect() (err error)

Connect proceeds to the GRPC connection step to the server.

func (*Client) Contains

func (c *Client) Contains(ctx context.Context, key string, value []byte) (contains bool, err error)

Contains returns wether or not a specific value is present in a container.

func (*Client) Get

func (c *Client) Get(ctx context.Context, key string) (value []byte, v *version.V, err error)

Get gets the key from the endpoint.

func (*Client) Members

func (c *Client) Members(ctx context.Context, key string) (values [][]byte, v *version.V, err error)

Members returns the slice of every element of a container.

func (*Client) SetPolicy

func (c *Client) SetPolicy(pol string)

SetPolicy sets the active client policy. Used for CLI mode mainly.

func (*Client) Submit

func (c *Client) Submit(ctx context.Context, tx *api.Transaction) (uuid string, err error)

Submit submits the transaction to the endpoint.

Jump to

Keyboard shortcuts

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