Add proxy mode.

This commit is contained in:
Ben Johnson
2014-02-18 13:29:18 -07:00
parent 8485987b74
commit 1d961b8e56
13 changed files with 522 additions and 69 deletions

View File

@ -0,0 +1,25 @@
package server
import (
"github.com/coreos/etcd/third_party/github.com/coreos/raft"
)
func init() {
raft.RegisterCommand(&SetClusterConfigCommand{})
}
// SetClusterConfigCommand sets the cluster-level configuration.
type SetClusterConfigCommand struct {
Config *ClusterConfig `json:"config"`
}
// CommandName returns the name of the command.
func (c *SetClusterConfigCommand) CommandName() string {
return "etcd:setClusterConfig"
}
// Apply updates the cluster configuration.
func (c *SetClusterConfigCommand) Apply(context raft.Context) (interface{}, error) {
ps, _ := context.Server().Context().(*PeerServer)
return nil, ps.SetClusterConfig(c.Config)
}