Files
etcd/command/command.go
2013-10-11 01:02:38 -06:00

20 lines
463 B
Go

package command
import (
"github.com/coreos/go-raft"
)
// A command represents an action to be taken on the replicated state machine.
type Command interface {
CommandName() string
Apply(server *raft.Server) (interface{}, error)
}
// Registers commands to the Raft library.
func Register() {
raft.RegisterCommand(&DeleteCommand{})
raft.RegisterCommand(&TestAndSetCommand{})
raft.RegisterCommand(&CreateCommand{})
raft.RegisterCommand(&UpdateCommand{})
}