func NewWatchServer(s *etcdserver.EtcdServer) pb.WatchServer { return &watchServer{ clusterID: int64(s.Cluster().ID()), memberID: int64(s.ID()), raftTimer: s, watchable: s.Watchable(), } }
func NewKVServer(s *etcdserver.EtcdServer) pb.KVServer { return &kvServer{ clusterID: int64(s.Cluster().ID()), memberID: int64(s.ID()), raftTimer: s, kv: s, } }
func newHeader(s *etcdserver.EtcdServer) header { return header{ clusterID: int64(s.Cluster().ID()), memberID: int64(s.ID()), raftTimer: s, rev: func() int64 { return s.KV().Rev() }, } }
// NewPeerHandler generates an http.Handler to handle etcd peer (raft) requests. func NewPeerHandler(server *etcdserver.EtcdServer) http.Handler { rh := rafthttp.NewHandler(server, server.Cluster.ID()) rsh := rafthttp.NewStreamHandler(server.SenderFinder(), server.ID(), server.Cluster.ID()) mh := &peerMembersHandler{ clusterInfo: server.Cluster, } mux := http.NewServeMux() mux.HandleFunc("/", http.NotFound) mux.Handle(rafthttp.RaftPrefix, rh) mux.Handle(rafthttp.RaftStreamPrefix+"/", rsh) mux.Handle(peerMembersPrefix, mh) return mux }
func NewQuotaLeaseServer(s *etcdserver.EtcdServer) pb.LeaseServer { return "aLeaseServer{ NewLeaseServer(s), quotaAlarmer{etcdserver.NewBackendQuota(s), s, s.ID()}, } }