Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidIP = errors.New("invalid IP")
var ErrInvalidIPv4 = errors.New("invalid IPv4")
var ErrInvalidIPv6 = errors.New("invalid IPv6")
Functions ¶
This section is empty.
Types ¶
type Duration ¶
Duration is a time.Duration wraper that marshals to and from a JSON string.
func (Duration) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type IP ¶
func (IP) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*IP) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type IPv4 ¶
func (IPv4) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*IPv4) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type IPv6 ¶
func (IPv6) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*IPv6) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type MailAddress ¶
MailAddress is a mail.Address wrapper that marshals to and from a JSON string.
func MustMailAddress ¶
func MustMailAddress(value string) MailAddress
MustMailAddress returns the MailAddress or panics.
func (MailAddress) MarshalJSON ¶
func (m MailAddress) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (MailAddress) String ¶
func (m MailAddress) String() string
String returns the MailAddress as a string.
func (*MailAddress) UnmarshalJSON ¶
func (m *MailAddress) UnmarshalJSON(data []byte) (err error)
UnmarshalJSON implements the json.Unmarshaler interface.
type POSIXRegexp ¶
POSIXRegexp is a POSIX regexp.Regexp wraper that marshals to and from a JSON string.
func MustPOSIXRegexp ¶
func MustPOSIXRegexp(value string) POSIXRegexp
MustPOSIXRegexp returns the POSIXRegexp or panics.
func (POSIXRegexp) MarshalJSON ¶
func (r POSIXRegexp) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (POSIXRegexp) String ¶
func (r POSIXRegexp) String() string
String returns the POSIXRegexp as a string.
func (*POSIXRegexp) UnmarshalJSON ¶
func (r *POSIXRegexp) UnmarshalJSON(data []byte) (err error)
UnmarshalJSON implements the json.Unmarshaler interface.
type Port ¶
type Port struct{ Port uint16 }
Port is a TCP/UDP port number that marshals to and from a JSON string or number.
func (Port) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*Port) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type Regexp ¶
Regexp is a regexp.Regexp wraper that marshals to and from a JSON string.
func (Regexp) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*Regexp) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type URL ¶
URL is a net/url.URL wraper that marshals to and from a JSON string.
func (URL) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*URL) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.