k3s/vendor/github.com/k3s-io/kine/pkg/server/lease.go

33 lines
1.1 KiB
Go
Raw Normal View History

2019-08-22 05:12:46 +00:00
package server
import (
"context"
"fmt"
2019-12-12 01:27:03 +00:00
"go.etcd.io/etcd/etcdserver/etcdserverpb"
2019-08-22 05:12:46 +00:00
)
func (s *KVServerBridge) LeaseGrant(ctx context.Context, req *etcdserverpb.LeaseGrantRequest) (*etcdserverpb.LeaseGrantResponse, error) {
return &etcdserverpb.LeaseGrantResponse{
Header: &etcdserverpb.ResponseHeader{},
ID: req.TTL,
TTL: req.TTL,
}, nil
}
func (s *KVServerBridge) LeaseRevoke(context.Context, *etcdserverpb.LeaseRevokeRequest) (*etcdserverpb.LeaseRevokeResponse, error) {
return nil, fmt.Errorf("lease revoke is not supported")
}
func (s *KVServerBridge) LeaseKeepAlive(etcdserverpb.Lease_LeaseKeepAliveServer) error {
return fmt.Errorf("lease keep alive is not supported")
}
func (s *KVServerBridge) LeaseTimeToLive(context.Context, *etcdserverpb.LeaseTimeToLiveRequest) (*etcdserverpb.LeaseTimeToLiveResponse, error) {
return nil, fmt.Errorf("lease time to live is not supported")
}
func (s *KVServerBridge) LeaseLeases(context.Context, *etcdserverpb.LeaseLeasesRequest) (*etcdserverpb.LeaseLeasesResponse, error) {
return nil, fmt.Errorf("lease leases is not supported")
}