addr

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidIP   = errors.New("invalid IP address")
	ErrInvalidPort = errors.New("invalid port number")
)
View Source
var ErrInvalidPublicIP = errors.New("invalid public IP address")

Functions

This section is empty.

Types

type Addr

type Addr struct {
	IP   [4]byte `json:"ip"`
	Port int     `json:"port"`
}
var Blank Addr // nolint: gochecknoglobals

func MustNewFromDotted added in v0.7.0

func MustNewFromDotted(ip string, port int) Addr

func New

func New(ip net.IP, port int) (Addr, error)

func NewForTesting

func NewForTesting(ip net.IP, port int) Addr

func NewFromDotted added in v0.7.0

func NewFromDotted(ip string, port int) (Addr, error)

func NewFromString

func NewFromString(addrAndPort string) (Addr, error)

func (Addr) GetDottedIP

func (a Addr) GetDottedIP() string

func (Addr) GetIP

func (a Addr) GetIP() net.IP

func (Addr) String

func (a Addr) String() string

type PublicAddr added in v0.8.0

type PublicAddr struct {
	// contains filtered or unexported fields
}
var BlankPublicAddr PublicAddr // nolint: gochecknoglobals

func MustNewPublicAddr added in v0.8.0

func MustNewPublicAddr(addr Addr) PublicAddr

func NewPublicAddr added in v0.8.0

func NewPublicAddr(addr Addr) (PublicAddr, error)

func (PublicAddr) ToAddr added in v0.8.0

func (pa PublicAddr) ToAddr() Addr

Jump to

Keyboard shortcuts

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