mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
change init func due to the change in raft
This commit is contained in:
14
command.go
14
command.go
@@ -23,7 +23,7 @@ type SetCommand struct {
|
||||
|
||||
// The name of the set command in the log
|
||||
func (c *SetCommand) CommandName() string {
|
||||
return "set"
|
||||
return "etcd:set"
|
||||
}
|
||||
|
||||
// Set the key-value pair
|
||||
@@ -56,7 +56,7 @@ type GetCommand struct {
|
||||
|
||||
// The name of the get command in the log
|
||||
func (c *GetCommand) CommandName() string {
|
||||
return "get"
|
||||
return "etcd:get"
|
||||
}
|
||||
|
||||
// Get the value of key
|
||||
@@ -71,7 +71,7 @@ type DeleteCommand struct {
|
||||
|
||||
// The name of the delete command in the log
|
||||
func (c *DeleteCommand) CommandName() string {
|
||||
return "delete"
|
||||
return "etcd:delete"
|
||||
}
|
||||
|
||||
// Delete the key
|
||||
@@ -87,7 +87,7 @@ type WatchCommand struct {
|
||||
|
||||
// The name of the watch command in the log
|
||||
func (c *WatchCommand) CommandName() string {
|
||||
return "watch"
|
||||
return "etcd:watch"
|
||||
}
|
||||
|
||||
func (c *WatchCommand) Apply(server *raft.Server) (interface{}, error) {
|
||||
@@ -113,7 +113,7 @@ type JoinCommand struct {
|
||||
|
||||
// The name of the join command in the log
|
||||
func (c *JoinCommand) CommandName() string {
|
||||
return "join"
|
||||
return "etcd:join"
|
||||
}
|
||||
|
||||
// Join a server to the cluster
|
||||
@@ -122,3 +122,7 @@ func (c *JoinCommand) Apply(raftServer *raft.Server) (interface{}, error) {
|
||||
addMachine(c.Name, c.Hostname, c.RaftPort, c.ClientPort)
|
||||
return []byte("join success"), err
|
||||
}
|
||||
|
||||
func (c *JoinCommand) NodeName() string {
|
||||
return c.Name
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user