api.go
func (r *Raft) AddPeer(peer ServerAddress) Future {
	if r.protocolVersion > 2 {
		return errorFuture{ErrUnsupportedProtocol}
	}

	return r.requestConfigChange(configurationChangeRequest{
		command:       AddStaging,
		serverID:      ServerID(peer),
		serverAddress: peer,
		prevIndex:     0,
	}, 0)
}
func (r *Raft) AddPeer(peer ServerAddress) Future {
	if r.protocolVersion > 2 {
		return errorFuture{ErrUnsupportedProtocol}
	}

	return r.requestConfigChange(configurationChangeRequest{
		command:       AddStaging,
		serverID:      ServerID(peer),
		serverAddress: peer,
		prevIndex:     0,
	}, 0)
}
func ( r * Raft ) AddPeer ( peer ServerAddress ) Future { if r . protocolVersion > 2 { return errorFuture { ErrUnsupportedProtocol } } return r . requestConfigChange ( configurationChangeRequest { command : AddStaging , serverID : ServerID ( peer ) , serverAddress : peer , prevIndex : 0 , } , 0 ) }
// AddPeer (deprecated) is used to add a new peer into the cluster. This must be
// run on the leader or it will fail. Use AddVoter/AddNonvoter instead.
AddPeer ( deprecated ) is used to add a new peer into the cluster . This must be run on the leader or it will fail . Use AddVoter / AddNonvoter instead .