go flavour
parent
981351c9d9
commit
c459b4bda7
4
etcd.go
4
etcd.go
|
@ -197,7 +197,7 @@ func main() {
|
||||||
r = newRaftServer(info.Name, info.RaftURL, &raftTLSConfig, &info.RaftTLS)
|
r = newRaftServer(info.Name, info.RaftURL, &raftTLSConfig, &info.RaftTLS)
|
||||||
|
|
||||||
startWebInterface()
|
startWebInterface()
|
||||||
r.run()
|
r.ListenAndServe()
|
||||||
e.run()
|
e.ListenAndServe()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,13 +36,13 @@ func newEtcdServer(name string, urlStr string, tlsConf *TLSConfig, tlsInfo *TLSI
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start to listen and response etcd client command
|
// Start to listen and response etcd client command
|
||||||
func (e *etcdServer) run() {
|
func (e *etcdServer) ListenAndServe() {
|
||||||
|
|
||||||
infof("etcd server [%s:%s]", e.name, e.url)
|
infof("etcd server [%s:%s]", e.name, e.url)
|
||||||
|
|
||||||
if e.tlsConf.Scheme == "http" {
|
if e.tlsConf.Scheme == "http" {
|
||||||
fatal(e.ListenAndServe())
|
fatal(e.Server.ListenAndServe())
|
||||||
} else {
|
} else {
|
||||||
fatal(e.ListenAndServeTLS(e.tlsInfo.CertFile, e.tlsInfo.KeyFile))
|
fatal(e.Server.ListenAndServeTLS(e.tlsInfo.CertFile, e.tlsInfo.KeyFile))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ func newRaftServer(name string, url string, tlsConf *TLSConfig, tlsInfo *TLSInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start the raft server
|
// Start the raft server
|
||||||
func (r *raftServer) run() {
|
func (r *raftServer) ListenAndServe() {
|
||||||
|
|
||||||
// Setup commands.
|
// Setup commands.
|
||||||
registerCommands()
|
registerCommands()
|
||||||
|
|
Loading…
Reference in New Issue