watchtower: rename DefaultPeerPortStr -> DefaultListenAddr

This commit is contained in:
Conner Fromknecht 2019-06-20 16:53:56 -07:00
parent b98bc76878
commit 7e81a5144e
No known key found for this signature in database
GPG Key ID: E7D737B67FA592C7
2 changed files with 6 additions and 4 deletions

@ -1,6 +1,7 @@
package watchtower
import (
"strconv"
"time"
)
@ -36,7 +37,7 @@ func (c *Conf) Apply(cfg *Config,
// If no addresses are specified by the Config, we will resort
// to the default peer port.
if len(c.RawListeners) == 0 {
addr := DefaultPeerPortStr
addr := DefaultListenAddr
c.RawListeners = append(c.RawListeners, addr)
}
@ -44,7 +45,7 @@ func (c *Conf) Apply(cfg *Config,
// used by the brontide listener.
var err error
cfg.ListenAddrs, err = normalizer(
c.RawListeners, DefaultPeerPortStr,
c.RawListeners, strconv.Itoa(DefaultPeerPort),
cfg.Net.ResolveTCPAddr,
)
if err != nil {

@ -28,8 +28,9 @@ const (
)
var (
// DefaultPeerPortStr is the default server port as a string.
DefaultPeerPortStr = fmt.Sprintf(":%d", DefaultPeerPort)
// DefaultListenAddr is the default watchtower address listening on all
// interfaces.
DefaultListenAddr = fmt.Sprintf(":%d", DefaultPeerPort)
)
// Config defines the resources and parameters used to configure a Watchtower.