ipv4

package
v0.0.0-...-d09d56a Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPv4

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

IPv4 is an IPv4 address

func Parse

func Parse(s string) *IPv4

Parse parses and returns the IPv4 address in s

func Random

func Random() *IPv4

Random returns a random IPv4 address

func (*IPv4) Addr

func (ip *IPv4) Addr() netip.Addr

Addr returns ip as Addr

func (*IPv4) Binary

func (ip *IPv4) Binary() string

Binary returns ip as a binary string

func (*IPv4) Broadcast

func (ip *IPv4) Broadcast() bool

Broadcast returns wether ip is a broadcast address

func (*IPv4) Decimal

func (ip *IPv4) Decimal() string

Decimal returns ip as dotted decimal

func (*IPv4) ExplainBin

func (ip *IPv4) ExplainBin() string

ExplainBin returns an explanation of the IP and its structure as string

func (*IPv4) ExplainDecimal

func (ip *IPv4) ExplainDecimal() string

ExplainDecimal returns an explanation of the IP and its structure as string

func (*IPv4) Host

func (ip *IPv4) Host() string

Host returns the host part of ip

func (*IPv4) Loopback

func (ip *IPv4) Loopback() bool

Loopback returns wether ip is a loopback address

func (*IPv4) Multicast

func (ip *IPv4) Multicast() bool

Multicast returns wether ip is a multicast address

func (*IPv4) Network

func (ip *IPv4) Network() string

Network returns the network part of ip

func (*IPv4) Prefix

func (ip *IPv4) Prefix() netip.Prefix

Prefix returns ip as Prefix

func (*IPv4) Private

func (ip *IPv4) Private() bool

Private returns wether ip is a private address

func (*IPv4) SetPrefix

func (ip *IPv4) SetPrefix(prefix string)

SetPrefix sets prefix in ip

func (*IPv4) SetPrefixLength

func (ip *IPv4) SetPrefixLength(numBits int)

SetPrefixLength sets prefix length of ip in number of bits

func (*IPv4) String

func (ip *IPv4) String() string

String returns ip as String

func (*IPv4) Type

func (ip *IPv4) Type() string

Type returns the type of ip

func (*IPv4) Unicast

func (ip *IPv4) Unicast() bool

Unicast returns wether ip is a unicast address

func (*IPv4) Unspecified

func (ip *IPv4) Unspecified() bool

Unspecified returns wether ip is the unspecified address

Jump to

Keyboard shortcuts

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