wanip

package
v2.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents an active wanip object

func New added in v2.9.0

func New(opts ...Option) *Client

New initializes a new wanip client

func (*Client) IPv4

func (c *Client) IPv4() (net.IP, Errors)

IPv4 returns your IPv4 address

func (*Client) IPv6

func (c *Client) IPv6() (net.IP, Errors)

IPv6 returns your IPv6 address

type Error

type Error struct {
	Err         error
	ProviderURL string
}

Error holds wanip error

type Errors

type Errors []Error

Errors holds slice of wanip errors

type Option added in v2.9.0

type Option func(b *Client)

Option provides a variadic option for configuring the client.

func WithInterfaceName added in v2.9.0

func WithInterfaceName(ifname string) Option

WithInterfaceName sets interface name.

func WithMaxRetries added in v2.9.0

func WithMaxRetries(maxRetries int) Option

WithMaxRetries sets max retries.

func WithUserAgent added in v2.9.0

func WithUserAgent(userAgent string) Option

WithUserAgent sets user agent.

Jump to

Keyboard shortcuts

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