checkip

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const IPv4CheckURL string = "https://checkip.amazonaws.com"

IPv4CheckURL is the endpoint to detect the public IPv4

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetPublicIPV4() (string, error)
}

Client is the interface for the checkip package

type ClientObj

type ClientObj struct {
	// contains filtered or unexported fields
}

ClientObj implements the Cliet interface per default

func New

func New() *ClientObj

New returns a new pointer instance of ClientObj with default values

func NewWithHTTPClient

func NewWithHTTPClient(httpClient httpclient.Client) *ClientObj

NewWithHTTPClient returns a new pointer instance of ClientObj with a custom http.Client

func (*ClientObj) GetPublicIPV4

func (c *ClientObj) GetPublicIPV4() (string, error)

GetPublicIPV4 fetches the current public IPv4 of this machine and network from an endpoint

Jump to

Keyboard shortcuts

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