mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
go flavour
This commit is contained in:
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)
|
||||
|
||||
startWebInterface()
|
||||
r.run()
|
||||
e.run()
|
||||
r.ListenAndServe()
|
||||
e.ListenAndServe()
|
||||
|
||||
}
|
||||
|
@ -36,13 +36,13 @@ func newEtcdServer(name string, urlStr string, tlsConf *TLSConfig, tlsInfo *TLSI
|
||||
}
|
||||
|
||||
// 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)
|
||||
|
||||
if e.tlsConf.Scheme == "http" {
|
||||
fatal(e.ListenAndServe())
|
||||
fatal(e.Server.ListenAndServe())
|
||||
} 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
|
||||
func (r *raftServer) run() {
|
||||
func (r *raftServer) ListenAndServe() {
|
||||
|
||||
// Setup commands.
|
||||
registerCommands()
|
||||
|
Loading…
x
Reference in New Issue
Block a user