WIP: Add metadata to store record (#1604)

* Add metadata to store record

* Add metadata to cockroach store

* add metadata to store service implementation

* fix breaking cache test

* Test/fix cockroach metadata usage

* fix store memory metadata bug
This commit is contained in:
Asim Aslam
2020-06-03 09:45:08 +01:00
committed by GitHub
parent e4e56b0f3f
commit 7b379bf1f1
10 changed files with 1378 additions and 937 deletions

View File

@@ -36,7 +36,12 @@ type Store interface {
// Record is an item stored or retrieved from a Store
type Record struct {
Key string `json:"key"`
Value []byte `json:"value"`
// The key to store the record
Key string `json:"key"`
// The value within the record
Value []byte `json:"value"`
// Any associated metadata for indexing
Metadata map[string]interface{} `json:"metadata"`
// Time to expire a record: TODO: change to timestamp
Expiry time.Duration `json:"expiry,omitempty"`
}