Browse Source

go flavour

Fabrizio (Misto) Milo 12 years ago
parent
commit
c459b4bda7
3 changed files with 6 additions and 6 deletions
  1. 2 2
      etcd.go
  2. 3 3
      etcd_server.go
  3. 1 1
      raft_server.go

+ 2 - 2
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()
 
 }

+ 3 - 3
etcd_server.go

@@ -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))
 	}
 }

+ 1 - 1
raft_server.go

@@ -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()