Documentation
¶
Index ¶
- type Chooser
- type DataStore
- func (ds *DataStore) Destroy(ctx context.Context) error
- func (ds *DataStore) FindPartition(tblName, rowKey string) (int, error)
- func (ds *DataStore) Get(ctx context.Context, tblName, rowKey, columnKey string, refKey int64) (cell models.Cell, found bool, err error)
- func (ds *DataStore) GetLatest(ctx context.Context, tblName, rowKey, columnKey string) (cell models.Cell, found bool, err error)
- func (ds *DataStore) PartitionRead(ctx context.Context, tblName string, partitionNumber int, location string, ...) (cells []models.Cell, found bool, err error)
- func (ds *DataStore) Put(ctx context.Context, tblName, rowKey, columnKey string, refKey int64, ...) error
- func (ds *DataStore) ResetConnection(ctx context.Context, tblName, rowKey string) error
- func (ds *DataStore) WithName(tblName string, bucketName string) *DataStore
- func (ds *DataStore) WithSources(tblName string, shards []core.Shard) *DataStore
- type Shard
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chooser ¶
type Chooser interface { // SetBuckets sets the list of known buckets from which the chooser should select SetBuckets([]string) error // Choose returns a bucket for a given key Choose(key string) string // Buckets returns the list of known buckets Buckets() []string }
Chooser maps keys to shards
type DataStore ¶
type DataStore struct {
// contains filtered or unexported fields
}
DataStore is our overall datastore structure, backed by at least one KVStore.
func (*DataStore) FindPartition ¶
FindPartition implements Storage.FindPartition()
func (*DataStore) Get ¶
func (ds *DataStore) Get(ctx context.Context, tblName, rowKey, columnKey string, refKey int64) (cell models.Cell, found bool, err error)
Get implements Storage.Get()
func (*DataStore) GetLatest ¶
func (ds *DataStore) GetLatest(ctx context.Context, tblName, rowKey, columnKey string) (cell models.Cell, found bool, err error)
GetLatest implements Storage.GetLatest()
func (*DataStore) PartitionRead ¶
func (ds *DataStore) PartitionRead(ctx context.Context, tblName string, partitionNumber int, location string, value int64, limit int) (cells []models.Cell, found bool, err error)
PartitionRead implements Storage.PartitionRead()
func (*DataStore) Put ¶
func (ds *DataStore) Put(ctx context.Context, tblName, rowKey, columnKey string, refKey int64, body string) error
Put implements Storage.Put()
func (*DataStore) ResetConnection ¶
ResetConnection implements Storage.ResetConnection()
type Storage ¶
type Storage interface { // Get the cell designated (row key, column key, ref key) Get(ctx context.Context, tblName, rowKey, columnKey string, refKey int64) (cell models.Cell, found bool, err error) // GetLatest returns the latest value for a given rowKey and columnKey, and a bool indicating if the key was present GetLatest(ctx context.Context, tblName, rowKey, columnKey string) (cell models.Cell, found bool, err error) // PartitionRead returns 'limit' cells after 'location' from shard 'shard_no' PartitionRead(ctx context.Context, tblName string, partitionNumber int, location string, value int64, limit int) (cells []models.Cell, found bool, err error) // Put inits a cell with given row key, column key, and ref key Put(ctx context.Context, tblName, rowKey, columnKey string, refKey int64, body string) (err error) // FindPartition returns the partition number for a specific rowKey FindPartition(tblName, rowKey string) int // ResetConnection reinitializes the connection for the shard responsible for a key ResetConnection(ctx context.Context, key string) error // Destroy cleans up any resources, etc. Destroy(ctx context.Context) error }
Storage is a key-value storage backend
Directories
¶
Path | Synopsis |
---|---|
examples
|
|
schemalessd/pkg/middleware/zap
Package zap is a mirror of https://github.com/treastech/logger/blob/master/logger.go with some slight tweaks in names.
|
Package zap is a mirror of https://github.com/treastech/logger/blob/master/logger.go with some slight tweaks in names. |
storage
|
|
mysql
Package mysql is a mysql-backed Schemaless store.
|
Package mysql is a mysql-backed Schemaless store. |
postgres
Package postgres is a postgres-backed Schemaless store.
|
Package postgres is a postgres-backed Schemaless store. |
tools
|
|
Click to show internal directories.
Click to hide internal directories.