Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Resolver ¶
Resolver resolves our public IP
func NewResolver ¶
func NewResolver(resolverName ResolverName) (Resolver, error)
Returns a new Resolver that uses the given service to resolve our public IP. If [resolverService] isn't one of the above, returns an error
type ResolverName ¶ added in v1.7.13
type ResolverName string
const ( // TODO remove either ifConfig or ifConfigCo. // They do the same thing. OpenDNS ResolverName = "opendns" IFConfig ResolverName = "ifconfig" IFConfigCo ResolverName = "ifconfigCo" IFConfigMe ResolverName = "ifconfigMe" )
type Updater ¶ added in v1.7.13
type Updater interface {
// Start periodically resolving and updating our public IP.
// Doesn't return until after Stop() is called.
// Should be called in a goroutine.
Dispatch(log logging.Logger)
// Stop resolving and updating our public IP.
Stop()
}
Updater periodically updates this node's public IP. Dispatch() and Stop() should only be called once.
func NewNoUpdater ¶ added in v1.7.13
func NewNoUpdater() Updater
func NewUpdater ¶ added in v1.7.13
func NewUpdater( dynamicIP ips.DynamicIPPort, resolver Resolver, updateFreq time.Duration, ) Updater
Returns a new Updater that updates [dynamicIP] every [updateFreq]. Uses [resolver] to find out what our public IP is.
Click to show internal directories.
Click to hide internal directories.