ip

package
v0.0.0-...-be0919c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resolver

type Resolver interface {
	GetPublicIP() (string, error)
	GetOutboundIP() (string, error)
}

Resolver allows resolving current IP

func NewResolver

func NewResolver(ipifyUrl string) Resolver

NewResolver creates new ipify based resolver with default timeout of one minute

func NewResolverFake

func NewResolverFake(ipAddress string) Resolver

NewResolverFake returns fakeResolver which resolves statically entered IP

func NewResolverFakeFailing

func NewResolverFakeFailing(err error) Resolver

NewResolverFakeFailing returns fakeResolver with entered error

func NewResolverWithTimeout

func NewResolverWithTimeout(ipifyUrl string, timeout time.Duration) Resolver

NewResolverWithTimeout creates new ipify based resolver with specified timeout

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL