mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
feat add modifiedIndex in kvpair
This commit is contained in:
parent
06f1b7f2e8
commit
cb4b6f1fe4
@ -12,6 +12,7 @@ type KeyValuePair struct {
|
|||||||
Expiration *time.Time `json:"expiration,omitempty"`
|
Expiration *time.Time `json:"expiration,omitempty"`
|
||||||
TTL int64 `json:"ttl,omitempty"` // Time to live in second
|
TTL int64 `json:"ttl,omitempty"` // Time to live in second
|
||||||
KVPairs kvPairs `json:"kvs,omitempty"`
|
KVPairs kvPairs `json:"kvs,omitempty"`
|
||||||
|
ModifiedIndex uint64 `json:"modifiedIndex,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type kvPairs []KeyValuePair
|
type kvPairs []KeyValuePair
|
||||||
|
@ -228,6 +228,7 @@ func (n *Node) Pair(recurisive, sorted bool) KeyValuePair {
|
|||||||
pair := KeyValuePair{
|
pair := KeyValuePair{
|
||||||
Key: n.Path,
|
Key: n.Path,
|
||||||
Dir: true,
|
Dir: true,
|
||||||
|
ModifiedIndex: n.ModifiedIndex,
|
||||||
}
|
}
|
||||||
pair.Expiration, pair.TTL = n.ExpirationAndTTL()
|
pair.Expiration, pair.TTL = n.ExpirationAndTTL()
|
||||||
|
|
||||||
@ -265,6 +266,7 @@ func (n *Node) Pair(recurisive, sorted bool) KeyValuePair {
|
|||||||
pair := KeyValuePair{
|
pair := KeyValuePair{
|
||||||
Key: n.Path,
|
Key: n.Path,
|
||||||
Value: n.Value,
|
Value: n.Value,
|
||||||
|
ModifiedIndex: n.ModifiedIndex,
|
||||||
}
|
}
|
||||||
pair.Expiration, pair.TTL = n.ExpirationAndTTL()
|
pair.Expiration, pair.TTL = n.ExpirationAndTTL()
|
||||||
return pair
|
return pair
|
||||||
|
Loading…
x
Reference in New Issue
Block a user