bump(github.com/benbjohnson/go-raft): d46748244f1f1830a002b8f645342426c5d73e81

This commit is contained in:
Brandon Philips
2013-08-06 11:18:15 -07:00
parent c03d4666b8
commit bb7ed9314b
53 changed files with 5337 additions and 0 deletions

View File

@ -0,0 +1,28 @@
package raft
// Join command interface
type JoinCommand interface {
CommandName() string
Apply(server *Server) (interface{}, error)
NodeName() string
}
// Join command
type DefaultJoinCommand struct {
Name string `json:"name"`
}
// The name of the Join command in the log
func (c *DefaultJoinCommand) CommandName() string {
return "raft:join"
}
func (c *DefaultJoinCommand) Apply(server *Server) (interface{}, error) {
err := server.AddPeer(c.Name)
return []byte("join"), err
}
func (c *DefaultJoinCommand) NodeName() string {
return c.Name
}