mirror of https://github.com/status-im/consul.git
Rename HTTP server method
This commit is contained in:
parent
052ce19ddd
commit
1e035d5453
|
@ -137,7 +137,7 @@ func (c *Command) setupAgent(config *Config, logOutput io.Writer, logWriter *log
|
||||||
c.rpcServer = NewAgentRPC(agent, rpcListener, logOutput, logWriter)
|
c.rpcServer = NewAgentRPC(agent, rpcListener, logOutput, logWriter)
|
||||||
|
|
||||||
if config.HTTPAddr != "" {
|
if config.HTTPAddr != "" {
|
||||||
server, err := NewServer(agent, logOutput, config.HTTPAddr)
|
server, err := NewHTTPServer(agent, logOutput, config.HTTPAddr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
agent.Shutdown()
|
agent.Shutdown()
|
||||||
c.Ui.Error(fmt.Sprintf("Error starting http server: %s", err))
|
c.Ui.Error(fmt.Sprintf("Error starting http server: %s", err))
|
||||||
|
|
|
@ -19,9 +19,9 @@ type HTTPServer struct {
|
||||||
logger *log.Logger
|
logger *log.Logger
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewServer starts a new HTTP server to provide an interface to
|
// NewHTTPServer starts a new HTTP server to provide an interface to
|
||||||
// the agent.
|
// the agent.
|
||||||
func NewServer(agent *Agent, logOutput io.Writer, bind string) (*HTTPServer, error) {
|
func NewHTTPServer(agent *Agent, logOutput io.Writer, bind string) (*HTTPServer, error) {
|
||||||
// Create the mux
|
// Create the mux
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
func makeHTTPServer(t *testing.T) (string, *HTTPServer) {
|
func makeHTTPServer(t *testing.T) (string, *HTTPServer) {
|
||||||
conf := nextConfig()
|
conf := nextConfig()
|
||||||
dir, agent := makeAgent(t, conf)
|
dir, agent := makeAgent(t, conf)
|
||||||
server, err := NewServer(agent, agent.logOutput, conf.HTTPAddr)
|
server, err := NewHTTPServer(agent, agent.logOutput, conf.HTTPAddr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue