mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdctl3: update to use RequestV2 instead of Request
This commit is contained in:
parent
758c3c09fd
commit
525fbba1bd
@ -218,8 +218,9 @@ func applyConf(cc raftpb.ConfChange, cl *membership.RaftCluster) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func applyRequest(r *pb.Request, applyV2 etcdserver.ApplierV2) {
|
func applyRequest(req *pb.Request, applyV2 etcdserver.ApplierV2) {
|
||||||
toTTLOptions(r)
|
r := (*etcdserver.RequestV2)(req)
|
||||||
|
r.TTLOptions()
|
||||||
switch r.Method {
|
switch r.Method {
|
||||||
case "POST":
|
case "POST":
|
||||||
applyV2.Post(r)
|
applyV2.Post(r)
|
||||||
@ -236,15 +237,6 @@ func applyRequest(r *pb.Request, applyV2 etcdserver.ApplierV2) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func toTTLOptions(r *pb.Request) store.TTLOptionSet {
|
|
||||||
refresh, _ := pbutil.GetBool(r.Refresh)
|
|
||||||
ttlOptions := store.TTLOptionSet{Refresh: refresh}
|
|
||||||
if r.Expiration != 0 {
|
|
||||||
ttlOptions.ExpireTime = time.Unix(0, r.Expiration)
|
|
||||||
}
|
|
||||||
return ttlOptions
|
|
||||||
}
|
|
||||||
|
|
||||||
func writeStore(w io.Writer, st store.Store) uint64 {
|
func writeStore(w io.Writer, st store.Store) uint64 {
|
||||||
all, err := st.Get("/1", true, true)
|
all, err := st.Get("/1", true, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user