Use Ports.HTTP directly

This commit is contained in:
Andy Lo-A-Foe 2015-08-20 20:27:20 +02:00
parent 4e2c3373bc
commit 3e046d3efc
2 changed files with 3 additions and 8 deletions

View File

@ -80,7 +80,7 @@ func (c *Command) readConfig() *Config {
cmdFlags.StringVar(&cmdConfig.ClientAddr, "client", "", "address to bind client listeners to (DNS, HTTP, HTTPS, RPC)") cmdFlags.StringVar(&cmdConfig.ClientAddr, "client", "", "address to bind client listeners to (DNS, HTTP, HTTPS, RPC)")
cmdFlags.StringVar(&cmdConfig.BindAddr, "bind", "", "address to bind server listeners to") cmdFlags.StringVar(&cmdConfig.BindAddr, "bind", "", "address to bind server listeners to")
cmdFlags.IntVar(&cmdConfig.HttpPort, "http-port", 0, "http port to use") cmdFlags.IntVar(&cmdConfig.Ports.HTTP, "http-port", 0, "http port to use")
cmdFlags.StringVar(&cmdConfig.AdvertiseAddr, "advertise", "", "address to advertise instead of bind addr") cmdFlags.StringVar(&cmdConfig.AdvertiseAddr, "advertise", "", "address to advertise instead of bind addr")
cmdFlags.StringVar(&cmdConfig.AdvertiseAddrWan, "advertise-wan", "", "address to advertise on wan instead of bind or advertise addr") cmdFlags.StringVar(&cmdConfig.AdvertiseAddrWan, "advertise-wan", "", "address to advertise on wan instead of bind or advertise addr")

View File

@ -141,11 +141,6 @@ type Config struct {
// client services (DNS, HTTP, HTTPS, RPC) // client services (DNS, HTTP, HTTPS, RPC)
ClientAddr string `mapstructure:"client_addr"` ClientAddr string `mapstructure:"client_addr"`
// HttpPort the HTTP port to listen on.
// This is useful e.g. when deploying to Cloud Foundry to make
// the HTTP API easily routable
HttpPort int `mapstructure:"http_port"`
// BindAddr is used to control the address we bind to. // BindAddr is used to control the address we bind to.
// If not specified, the first private IP we find is used. // If not specified, the first private IP we find is used.
// This controls the address we use for cluster facing // This controls the address we use for cluster facing
@ -854,8 +849,8 @@ func MergeConfig(a, b *Config) *Config {
if b.BindAddr != "" { if b.BindAddr != "" {
result.BindAddr = b.BindAddr result.BindAddr = b.BindAddr
} }
if b.HttpPort != 0 { if b.Ports.HTTP != 0 {
result.Ports.HTTP = b.HttpPort result.Ports.HTTP = b.Ports.HTTP
} }
if b.AdvertiseAddr != "" { if b.AdvertiseAddr != "" {
result.AdvertiseAddr = b.AdvertiseAddr result.AdvertiseAddr = b.AdvertiseAddr