|
|
@@ -1,11 +1,17 @@
|
|
|
package store
|
|
|
|
|
|
+import (
|
|
|
+ "time"
|
|
|
+)
|
|
|
+
|
|
|
// When user list a directory, we add all the node into key-value pair slice
|
|
|
type KeyValuePair struct {
|
|
|
- Key string `json:"key, omitempty"`
|
|
|
- Value string `json:"value,omitempty"`
|
|
|
- Dir bool `json:"dir,omitempty"`
|
|
|
- KVPairs kvPairs `json:"kvs,omitempty"`
|
|
|
+ Key string `json:"key, omitempty"`
|
|
|
+ Value string `json:"value,omitempty"`
|
|
|
+ Dir bool `json:"dir,omitempty"`
|
|
|
+ Expiration *time.Time `json:"expiration,omitempty"`
|
|
|
+ TTL int64 `json:"ttl,omitempty"` // Time to live in second
|
|
|
+ KVPairs kvPairs `json:"kvs,omitempty"`
|
|
|
}
|
|
|
|
|
|
type kvPairs []KeyValuePair
|