Documentation ¶
Overview ¶
Package commontypes provides the few types I'm always creating for various projects. I've decided that rather than continuing to do them by hand every single time, I'm going to dump them up here and import them.
Have included (Unm|M)arshalText and (Unm|M)arshalJSON for all types for convenient loading from configuration files/json blobs.
Index ¶
- Variables
- type Duration
- type IP
- type KeyFile
- type Network
- type Networks
- type Regexp
- type Regexps
- type URL
- func (u URL) MarshalJSON() ([]byte, error)
- func (u URL) MarshalTOML() (interface{}, error)
- func (u *URL) MarshalText() ([]byte, error)
- func (u *URL) Unmarshal(s string) (err error)
- func (u *URL) UnmarshalJSON(data []byte) error
- func (u *URL) UnmarshalTOML(text []byte) error
- func (u *URL) UnmarshalText(text []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var PrivateNetworks = Networks{ Network{&net.IPNet{IP: net.IP{0, 0, 0, 0}, Mask: net.IPMask{255, 0, 0, 0}}}, Network{&net.IPNet{IP: net.IP{10, 0, 0, 0}, Mask: net.IPMask{255, 0, 0, 0}}}, Network{&net.IPNet{IP: net.IP{100, 64, 0, 0}, Mask: net.IPMask{255, 192, 0, 0}}}, Network{&net.IPNet{IP: net.IP{127, 0, 0, 0}, Mask: net.IPMask{255, 0, 0, 0}}}, Network{&net.IPNet{IP: net.IP{172, 16, 0, 0}, Mask: net.IPMask{255, 240, 0, 0}}}, Network{&net.IPNet{IP: net.IP{192, 0, 0, 0}, Mask: net.IPMask{255, 255, 255, 0}}}, Network{&net.IPNet{IP: net.IP{192, 0, 2, 0}, Mask: net.IPMask{255, 255, 255, 0}}}, Network{&net.IPNet{IP: net.IP{192, 88, 99, 0}, Mask: net.IPMask{255, 255, 255, 0}}}, Network{&net.IPNet{IP: net.IP{192, 168, 0, 0}, Mask: net.IPMask{255, 255, 0, 0}}}, Network{&net.IPNet{IP: net.IP{198, 18, 0, 0}, Mask: net.IPMask{255, 254, 0, 0}}}, Network{&net.IPNet{IP: net.IP{198, 51, 100, 0}, Mask: net.IPMask{255, 255, 255, 0}}}, Network{&net.IPNet{IP: net.IP{203, 0, 113, 0}, Mask: net.IPMask{255, 255, 255, 0}}}, }
PrivateNetworks is a list of commonly defined private networks most useful for figuring out if a private ip address has been provided
Functions ¶
This section is empty.
Types ¶
type Duration ¶
func (Duration) MarshalJSON ¶
func (Duration) MarshalText ¶
func (*Duration) UnmarshalJSON ¶
func (*Duration) UnmarshalText ¶
type IP ¶
func (*IP) IsUnspecified ¶
func (*IP) MarshalJSON ¶
func (*IP) MarshalText ¶
func (*IP) UnmarshalJSON ¶
func (*IP) UnmarshalTOML ¶
func (*IP) UnmarshalText ¶
type KeyFile ¶
type KeyFile struct {
// contains filtered or unexported fields
}
func (*KeyFile) MarshalJSON ¶
func (*KeyFile) MarshalText ¶
func (*KeyFile) UnmarshalJSON ¶
func (*KeyFile) UnmarshalText ¶
type Network ¶
func (*Network) MarshalJSON ¶
func (*Network) MarshalText ¶
func (*Network) UnmarshalJSON ¶
func (*Network) UnmarshalTOML ¶
func (*Network) UnmarshalText ¶
type Regexp ¶
func (*Regexp) MarshalJSON ¶
func (*Regexp) MarshalText ¶
func (*Regexp) UnmarshalJSON ¶
func (*Regexp) UnmarshalTOML ¶
func (*Regexp) UnmarshalText ¶
type URL ¶
func (URL) MarshalJSON ¶
func (URL) MarshalTOML ¶
func (*URL) MarshalText ¶
func (*URL) UnmarshalJSON ¶
func (*URL) UnmarshalTOML ¶
func (*URL) UnmarshalText ¶
Click to show internal directories.
Click to hide internal directories.