mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
commit
961f62d548
@ -28,7 +28,7 @@ func Multiplexer(w http.ResponseWriter, req *http.Request) {
|
||||
|
||||
//--------------------------------------
|
||||
// State sensitive handlers
|
||||
// Set/Delte will dispatch to leader
|
||||
// Set/Delete will dispatch to leader
|
||||
//--------------------------------------
|
||||
|
||||
// Set Command Handler
|
||||
@ -193,9 +193,9 @@ func MachinesHttpHandler(w http.ResponseWriter, req *http.Request) {
|
||||
// Since peer map does not contain the server itself
|
||||
machines, _ := getClientAddr(raftServer.Name())
|
||||
|
||||
// Add all peers to the list and sepearte by comma
|
||||
// Add all peers to the list and separate by comma
|
||||
// We do not use json here since we accept machines list
|
||||
// in the command line seperate by comma.
|
||||
// in the command line separate by comma.
|
||||
|
||||
for peerName, _ := range peers {
|
||||
if addr, ok := getClientAddr(peerName); ok {
|
||||
|
4
etcd.go
4
etcd.go
@ -165,7 +165,7 @@ func main() {
|
||||
|
||||
info = getInfo(dirPath)
|
||||
|
||||
// secrity type
|
||||
// security type
|
||||
st := securityType(SERVER)
|
||||
|
||||
clientSt := securityType(CLIENT)
|
||||
@ -277,7 +277,7 @@ func startRaft(securityType int) {
|
||||
|
||||
// Create transporter using by raft server
|
||||
// Create http or https transporter based on
|
||||
// wether the user give the server cert and key
|
||||
// whether the user give the server cert and key
|
||||
func createTransporter(st int) transporter {
|
||||
t := transporter{}
|
||||
|
||||
|
@ -89,7 +89,7 @@ func (t transporter) SendSnapshotRequest(server *raft.Server, peer *raft.Peer, r
|
||||
return aersp
|
||||
}
|
||||
|
||||
// Get the the client address of the leader in the cluster
|
||||
// Get the client address of the leader in the cluster
|
||||
func (t transporter) GetLeaderClientAddress() string {
|
||||
resp, _ := t.Get(raftServer.Leader() + "/client")
|
||||
if resp != nil {
|
||||
|
4
util.go
4
util.go
@ -15,11 +15,11 @@ import (
|
||||
//--------------------------------------
|
||||
var storeMsg chan string
|
||||
|
||||
// Help to send msg from stroe to webHub
|
||||
// Help to send msg from store to webHub
|
||||
func webHelper() {
|
||||
storeMsg = make(chan string)
|
||||
for {
|
||||
// transfere the new msg to webHub
|
||||
// transfer the new msg to webHub
|
||||
web.Hub().Send(<-storeMsg)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user