client

package
v0.0.0-...-ac41614 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultClientTimeout = time.Second * 10

Variables

View Source
var EClientTimeout = errors.New("Client request timed out")

Functions

This section is empty.

Types

type APIClient

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

func New

func New(config APIClientConfig) *APIClient

func (*APIClient) AddRelay

func (client *APIClient) AddRelay(ctx context.Context, relayID string) error

func (*APIClient) AddSite

func (client *APIClient) AddSite(ctx context.Context, siteID string) error

func (*APIClient) Batch

func (client *APIClient) Batch(ctx context.Context, siteID string, bucket string, batch Batch) (int, int, error)

func (*APIClient) ClusterOverview

func (client *APIClient) ClusterOverview(ctx context.Context) (routes.ClusterOverview, error)

func (*APIClient) DownloadSnapshot

func (client *APIClient) DownloadSnapshot(ctx context.Context, uuid string) (io.ReadCloser, error)

func (*APIClient) Get

func (client *APIClient) Get(ctx context.Context, siteID string, bucket string, keys []string) ([]Entry, error)

func (*APIClient) GetMatches

func (client *APIClient) GetMatches(ctx context.Context, siteID string, bucket string, keys []string) (EntryIterator, error)

func (*APIClient) GetSnapshot

func (client *APIClient) GetSnapshot(ctx context.Context, uuid string) (routes.Snapshot, error)

func (*APIClient) LogDump

func (client *APIClient) LogDump(ctx context.Context) (routes.LogDump, error)

func (*APIClient) MoveRelay

func (client *APIClient) MoveRelay(ctx context.Context, relayID string, siteID string) error

func (*APIClient) RelayStatus

func (client *APIClient) RelayStatus(ctx context.Context, relayID string) (routes.RelayStatus, error)

func (*APIClient) RemoveRelay

func (client *APIClient) RemoveRelay(ctx context.Context, relayID string) error

func (*APIClient) RemoveSite

func (client *APIClient) RemoveSite(ctx context.Context, siteID string) error

func (*APIClient) Snapshot

func (client *APIClient) Snapshot(ctx context.Context) (routes.Snapshot, error)

type APIClientConfig

type APIClientConfig struct {
	Servers []string
}

type Batch

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

Contains a database update operation

func NewBatch

func NewBatch() *Batch

Create a new batch update

func (*Batch) Delete

func (batch *Batch) Delete(key string, context string) *Batch

func (*Batch) Put

func (batch *Batch) Put(key string, value string, context string) *Batch

Adds a key put operation to this update. Key and value are the key that is being modified and the value that it should be set to. context is the causal context for the modification. It can be left blank if

func (*Batch) ToTransportUpdateBatch

func (batch *Batch) ToTransportUpdateBatch() transport.TransportUpdateBatch

type Client

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

func NewClient

func NewClient(config ClientConfig) *Client

func (*Client) AddNode

func (client *Client) AddNode(ctx context.Context, memberAddress PeerAddress, newMemberConfig NodeConfig) error

Use an existing cluster member to bootstrap the addition of another node to that cluster. host and port indicate the address of the existing cluster member while nodeAddress contains the ID, host name and port of the new cluster member

Return Values:

EClientTimeout: The request to the node timed out

func (*Client) DecommissionNode

func (client *Client) DecommissionNode(ctx context.Context, memberAddress PeerAddress, nodeID uint64) error

func (*Client) ForceRemoveNode

func (client *Client) ForceRemoveNode(ctx context.Context, memberAddress PeerAddress, nodeID uint64) error

func (*Client) MerkleTreeNode

func (client *Client) MerkleTreeNode(ctx context.Context, memberAddress PeerAddress, siteID string, bucketName string, nodeID uint32) (rest.MerkleNode, error)

func (*Client) MerkleTreeNodeKeys

func (client *Client) MerkleTreeNodeKeys(ctx context.Context, memberAddress PeerAddress, siteID string, bucketName string, nodeID uint32) (rest.MerkleKeys, error)

func (*Client) MerkleTreeStats

func (client *Client) MerkleTreeStats(ctx context.Context, memberAddress PeerAddress, siteID string, bucketName string) (rest.MerkleTree, error)

func (*Client) RemoveNode

func (client *Client) RemoveNode(ctx context.Context, memberAddress PeerAddress, nodeID uint64, replacementNodeID uint64, decommission, forwarded bool) error

Ask a cluster member to initiate the removal of some node from its cluster. host and port indicate the address of the initiator node while nodeID is the ID of the node that should be removed.

Return Values:

EClientTimeout: The request to the node timed out

func (*Client) ReplaceNode

func (client *Client) ReplaceNode(ctx context.Context, memberAddress PeerAddress, nodeID uint64, replacementNodeID uint64) error

type ClientConfig

type ClientConfig struct {
	Timeout time.Duration
}

type Entry

type Entry struct {
	Siblings []string
	Context  string
}

type EntryIterator

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

func (*EntryIterator) Entry

func (iter *EntryIterator) Entry() Entry

func (*EntryIterator) Key

func (iter *EntryIterator) Key() string

func (*EntryIterator) Next

func (iter *EntryIterator) Next() bool

func (*EntryIterator) Prefix

func (iter *EntryIterator) Prefix() string

type ErrorStatusCode

type ErrorStatusCode struct {
	StatusCode int
	Message    string
}

func (*ErrorStatusCode) Error

func (errorStatus *ErrorStatusCode) Error() string

Jump to

Keyboard shortcuts

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