client

package
v0.0.0-...-5a82b97 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoDataNodes = errors.New(
	"No data nodes could be found for the requested range")

ErrNoDataNodes indicates that no data nodes could be found covering the requested range.

Functions

func GetMasterConnection

func GetMasterConnection(
	ctx context.Context,
	tlsConfig *tls.Config,
	etcdClient *etcd.Client,
	path string) (*grpc.ClientConn, error)

GetMasterConnection finds the master for the red-cloud instance associated with the given path and returns it.

func SplitTablePath

func SplitTablePath(path string) (instance string, table string, err error)

SplitTablePath splits the instance and table name (if specified) out of a red-cloud URL.

Types

type DataAccessClient

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

DataAccessClient is a client library allowing users to have convenient access to data stored in red-cloud without having to implement data node discovery and other related algorithms.

func NewDataAccessClient

func NewDataAccessClient(
	instance string,
	etcdClient *etcd.Client,
	tlsConfig *tls.Config) *DataAccessClient

NewDataAccessClient creates a new DataAccessClient.

func (*DataAccessClient) Get

func (d *DataAccessClient) Get(
	parentCtx context.Context, req *redcloud.GetRequest,
	opts ...grpc.CallOption) (*redcloud.Column, error)

Get requests the latest version of a single key of data from the specified column path (table, row, column family, column).

func (*DataAccessClient) GetRange

func (d *DataAccessClient) GetRange(
	parentCtx context.Context, req *redcloud.GetRangeRequest,
	resp chan *redcloud.ColumnSet, opts ...grpc.CallOption) error

GetRange requests all versions of a key range of data from the specified column paths (table, row, column family, columns).

func (*DataAccessClient) Insert

func (d *DataAccessClient) Insert(
	parentCtx context.Context, req *redcloud.InsertRequest,
	opts ...grpc.CallOption) error

Insert requests to place a new version of a column into the database. The destination of the column must be specified as a (table, row, column family, column) tuple.

Jump to

Keyboard shortcuts

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