Exemplo n.º 1
0
func (c *AddPotentialServerCommand) Apply(server raft.Server) (interface{}, error) {
	config := server.Context().(*ClusterConfiguration)
	config.AddPotentialServer(c.Server)
	return nil, nil
}
Exemplo n.º 2
0
func (c *CreateDatabaseCommand) Apply(server raft.Server) (interface{}, error) {
	config := server.Context().(*ClusterConfiguration)
	err := config.CreateDatabase(c.Name)
	return nil, err
}
Exemplo n.º 3
0
func (c *SaveClusterAdminCommand) Apply(server raft.Server) (interface{}, error) {
	config := server.Context().(*ClusterConfiguration)
	config.SaveClusterAdmin(c.User)
	return nil, nil
}
Exemplo n.º 4
0
func (c *UpdateServerStateCommand) Apply(server raft.Server) (interface{}, error) {
	config := server.Context().(*ClusterConfiguration)
	err := config.UpdateServerState(c.ServerId, c.State)
	return nil, err
}