Documentation
¶
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) CreateObject(data []byte) (key []byte, err error)
- func (c *Client) DeleteObject(key []byte) error
- func (c *Client) ExistObject(key []byte) (bool, error)
- func (c *Client) GetNamespace() (*datastor.Namespace, error)
- func (c *Client) GetObject(key []byte) (*datastor.Object, error)
- func (c *Client) GetObjectStatus(key []byte) (datastor.ObjectStatus, error)
- func (c *Client) ListObjectKeyIterator(ctx context.Context) (<-chan datastor.ObjectKeyResult, error)
- type Cluster
- type Shard
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client defines a data client, to connect to a 0-db server
func NewClient ¶
NewClient creates a new data client, with given server address & password, and use the given namespace.
func (*Client) CreateObject ¶
CreateObject implements datastor.Client.CreateObject
func (*Client) DeleteObject ¶
DeleteObject implements datastor.Client.DeleteObject
func (*Client) ExistObject ¶
ExistObject implements datastor.Client.ExistObject
func (*Client) GetNamespace ¶
GetNamespace implements datastor.Client.GetNamespace
func (*Client) GetObjectStatus ¶
func (c *Client) GetObjectStatus(key []byte) (datastor.ObjectStatus, error)
GetObjectStatus implements datastor.Client.GetObjectStatus
func (*Client) ListObjectKeyIterator ¶
func (c *Client) ListObjectKeyIterator(ctx context.Context) (<-chan datastor.ObjectKeyResult, error)
ListObjectKeyIterator implements datastor.Client.ListObjectKeyIterator TODO: depend on https://github.com/zero-os/0-db/issues/6
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster implements datastor.Cluster for clients which interface with 0-db server using redis protocol
func NewCluster ¶
func NewCluster(addresses []string, passwd, namespace string, tlsConfig *tls.Config) (*Cluster, error)
NewCluster creates a new cluster, and pre-loading it with a client for each of the listed (and thus known) shards. Unlisted shards's clients are also stored, bu those are loaded on the fly, only when needed.
func (*Cluster) GetRandomShard ¶
GetRandomShard implements datastor.Cluster.GetRandomShard
func (*Cluster) GetRandomShardIterator ¶
func (c *Cluster) GetRandomShardIterator(exceptShards []string) datastor.ShardIterator
GetRandomShardIterator implements datastor.Cluster.GetRandomShardIterator
func (*Cluster) ListedShardCount ¶
ListedShardCount implements datastor.Cluster.ListedShardCount
type Shard ¶
type Shard struct { *Client // contains filtered or unexported fields }
Shard implements datastor.Shard for 0-db clients, to make those clients work within a cluster of other 0-db clients.
func (*Shard) Identifier ¶
Identifier implements datastor.Shard.Identifier