package netutil
import "github.com/teamwork/utils/netutil"
Index ¶
- func RemovePort(host string) string
- type IP
- func (ip IP) Eq(cmp net.IP) bool
- func (ip IP) Gt(start net.IP) bool
- func (ip IP) Gte(start net.IP) bool
- func (ip IP) InRange(start, end net.IP) bool
- func (ip IP) Lt(end net.IP) bool
- func (ip IP) Lte(end net.IP) bool
- func (ip *IP) MarshalJSON() ([]byte, error)
- func (ip *IP) Scan(value interface{}) error
- func (ip IP) String() string
- func (ip *IP) UnmarshalJSON(data []byte) error
- func (ip IP) Value() (driver.Value, error)
Functions ¶
func RemovePort ¶
RemovePort removes the "port" part of an hostname.
Types ¶
type IP ¶
IP is a special wrapped type of net.IP
func (IP) Eq ¶
Eq will return if the IP is less than to the given IP
func (IP) Gt ¶
Gt will return if the IP is greater than to the given IP
func (IP) Gte ¶
Gte will return if the IP is greater than or equal to the given IP
func (IP) InRange ¶
InRange will return if the IP is within the given range of addresses
func (IP) Lt ¶
Lt will return if the IP is less than to the given IP
func (IP) Lte ¶
Lte will return if the IP is less than or equal to the given IP
func (*IP) MarshalJSON ¶
MarshalJSON specifies how the IP should be returned in the JSON. For this we can just utilise the existing custom marshaling on the net.IP object as it already does what we need.
func (*IP) Scan ¶
Scan will return the IP from the database
func (IP) String ¶
String returns the IP as a string
func (*IP) UnmarshalJSON ¶
UnmarshalJSON specifies how the IP should be parsed from the JSON. For this we can just utilise the existing custom marshaling on the net.IP object as it already does what we need.
func (IP) Value ¶
Value will get the value for storing in SQL
Source Files ¶
- Version
- v1.0.0 (latest)
- Published
- Mar 14, 2022
- Platform
- darwin/amd64
- Imports
- 5 packages
- Last checked
- 1 hour ago –
Tools for package owners.