open-consul/consul/raft_endpoint.go

21 lines
405 B
Go
Raw Normal View History

2013-12-09 22:49:07 +00:00
package consul
import (
"net"
)
// Raft endpoint is used to manipulate the Raft subsystem
type Raft struct {
server *Server
}
func (r *Raft) RemovePeer(args string, reply *struct{}) error {
peer, err := net.ResolveTCPAddr("tcp", args)
if err != nil {
r.server.logger.Printf("[ERR] Failed to parse peer: %v", err)
return err
}
future := r.server.raft.RemovePeer(peer)
2013-12-09 22:49:07 +00:00
return future.Error()
}