ip

package
v0.0.0-...-fd49038 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyValue = errors.New("ip address cannot be empty")

Functions

This section is empty.

Types

type IP

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

func FromString

func FromString(value string) (IP, error)

func (IP) IPv4

func (ip IP) IPv4() IPv4

func (IP) IPv6

func (ip IP) IPv6() IPv6

func (IP) IsIPv6

func (ip IP) IsIPv6() bool

func (IP) MarshalJSON

func (ip IP) MarshalJSON() ([]byte, error)

MarshalJSON marshall implementation for IP

func (IP) String

func (ip IP) String() string

String implementation of Stringer interface

func (*IP) UnmarshalJSON

func (ip *IP) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshall implementation for IP

func (IP) Validate

func (ip IP) Validate() error

Validate implementation of ozzo-validation Validate interface

func (IP) Value

func (ip IP) Value() (value driver.Value, err error)

Value implementation of driver.Valuer

type IPv4

type IPv4 string

func V4FromString

func V4FromString(value string) (IPv4, error)

func (IPv4) String

func (ip IPv4) String() string

String implementation of Stringer interface

func (*IPv4) UnmarshalJSON

func (ip *IPv4) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshall implementation for IP

func (IPv4) Validate

func (ip IPv4) Validate() error

Validate implementation of ozzo-validation Validate interface

func (IPv4) Value

func (ip IPv4) Value() (value driver.Value, err error)

Value implementation of driver.Valuer

type IPv6

type IPv6 string

func V6FromString

func V6FromString(value string) (IPv6, error)

func (IPv6) String

func (ip IPv6) String() string

String implementation of Stringer interface

func (*IPv6) UnmarshalJSON

func (ip *IPv6) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshall implementation for IP

func (IPv6) Validate

func (ip IPv6) Validate() error

Validate implementation of ozzo-validation Validate interface

func (IPv6) Value

func (ip IPv6) Value() (value driver.Value, err error)

Value implementation of driver.Valuer

Jump to

Keyboard shortcuts

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