Skip to content

Commit

Permalink
embed: add Election service
Browse files Browse the repository at this point in the history
  • Loading branch information
heyitsanthony committed Mar 31, 2017
1 parent 5aa78e3 commit 293a982
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions embed/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (

"github.com/coreos/etcd/etcdserver"
"github.com/coreos/etcd/etcdserver/api/v3client"
"github.com/coreos/etcd/etcdserver/api/v3election"
"github.com/coreos/etcd/etcdserver/api/v3election/v3electionpb"
"github.com/coreos/etcd/etcdserver/api/v3lock"
"github.com/coreos/etcd/etcdserver/api/v3lock/v3lockpb"
"github.com/coreos/etcd/etcdserver/api/v3rpc"
Expand Down Expand Up @@ -71,6 +73,7 @@ func (sctx *serveCtx) serve(s *etcdserver.EtcdServer, tlscfg *tls.Config, handle

if sctx.insecure {
gs := v3rpc.Server(s, nil)
v3electionpb.RegisterElectionServer(gs, v3election.NewElectionServer(v3client.New(s)))
v3lockpb.RegisterLockServer(gs, v3lock.NewLockServer(v3client.New(s)))
if sctx.serviceRegister != nil {
sctx.serviceRegister(gs)
Expand Down Expand Up @@ -99,6 +102,7 @@ func (sctx *serveCtx) serve(s *etcdserver.EtcdServer, tlscfg *tls.Config, handle

if sctx.secure {
gs := v3rpc.Server(s, tlscfg)
v3electionpb.RegisterElectionServer(gs, v3election.NewElectionServer(v3client.New(s)))
v3lockpb.RegisterLockServer(gs, v3lock.NewLockServer(v3client.New(s)))
if sctx.serviceRegister != nil {
sctx.serviceRegister(gs)
Expand Down

0 comments on commit 293a982

Please sign in to comment.