Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatIPForURL ¶
FormatIPForURL basically puts brackets [] around the IP if it is IPv6
Types ¶
type LocalIPResolver ¶
type LocalIPResolver struct { }
LocalIPResolver resolves to a local ip addresse. Defaults to 127.0.0.1. Zero value is usable.
func (*LocalIPResolver) Resolve ¶
func (l *LocalIPResolver) Resolve() string
Resolve resolves to the first local non loopback addresse it finds. Defaults to 127.0.0.1
type PublicIPResolver ¶
type PublicIPResolver struct {
Fallback IPResolver
}
PublicIPResolver resolves the public ip by querying another server. If an error occurs the Fallback resolver is used. Zero value is *not* usable.
func NewPublicIPResolver ¶
func NewPublicIPResolver(fallback IPResolver) *PublicIPResolver
NewPublicIPResolver creaes a new PublicIpResolver. fallback must not be null.
func (*PublicIPResolver) Resolve ¶
func (p *PublicIPResolver) Resolve() string
Resolve gets your public ip from a remote server. Defaults to fallback resolver on errors
Click to show internal directories.
Click to hide internal directories.