func applyLeaseCreate(le lease.Lessor, lc *pb.LeaseCreateRequest) (*pb.LeaseCreateResponse, error) { l, err := le.Grant(lease.LeaseID(lc.ID), lc.TTL) resp := &pb.LeaseCreateResponse{} if err == nil { resp.ID = int64(l.ID) resp.TTL = l.TTL } return resp, err }
func applyLeaseGrant(lessor lease.Lessor, req *etcdserverpb.LeaseGrantRequest) (*etcdserverpb.LeaseGrantResponse, error) { l, err := lessor.Grant(lease.LeaseID(req.ID), req.TTL) resp := &etcdserverpb.LeaseGrantResponse{} if err == nil { resp.ID = int64(l.ID) resp.TTL = l.TTL } return resp, err }
func applyLeaseCreate(le lease.Lessor, lc *pb.LeaseCreateRequest) (*pb.LeaseCreateResponse, error) { l := le.Grant(lc.TTL) return &pb.LeaseCreateResponse{ID: int64(l.ID), TTL: l.TTL}, nil }