Skip to content

Commit

Permalink
etcdserver: use v3server interface
Browse files Browse the repository at this point in the history
  • Loading branch information
xiang90 committed Aug 8, 2015
1 parent 523567b commit 264b570
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions etcdserver/api/v3rpc/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
)

type handler struct {
server etcdserver.Server
server etcdserver.V3DemoServer
}

func New(s etcdserver.Server) pb.EtcdServer {
func New(s etcdserver.V3DemoServer) pb.EtcdServer {
return &handler{s}
}

Expand Down
2 changes: 0 additions & 2 deletions etcdserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (

"github.com/coreos/etcd/Godeps/_workspace/src/github.com/coreos/go-semver/semver"
"github.com/coreos/etcd/Godeps/_workspace/src/github.com/coreos/pkg/capnslog"
"github.com/coreos/etcd/Godeps/_workspace/src/github.com/gogo/protobuf/proto"
"github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context"
"github.com/coreos/etcd/discovery"
"github.com/coreos/etcd/etcdserver/etcdhttp/httptypes"
Expand Down Expand Up @@ -109,7 +108,6 @@ type Server interface {
Leader() types.ID
// Do takes a request and attempts to fulfill it, returning a Response.
Do(ctx context.Context, r pb.Request) (Response, error)
V3DemoDo(ctx context.Context, r pb.InternalRaftRequest) proto.Message
// Process takes a raft message and applies it to the server's raft state
// machine, respecting any timeout of the given context.
Process(ctx context.Context, m raftpb.Message) error
Expand Down
4 changes: 4 additions & 0 deletions etcdserver/v3demo_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ import (
pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
)

type V3DemoServer interface {
V3DemoDo(ctx context.Context, r pb.InternalRaftRequest) proto.Message
}

func (s *EtcdServer) V3DemoDo(ctx context.Context, r pb.InternalRaftRequest) proto.Message {
switch {
case r.Range != nil:
Expand Down

0 comments on commit 264b570

Please sign in to comment.