type net/netip.Addr
110 uses
net/netip (current package)
netip.go#L38: type Addr struct {
netip.go#L76: func IPv6LinkLocalAllNodes() Addr { return AddrFrom16([16]byte{0: 0xff, 1: 0x02, 15: 0x01}) }
netip.go#L80: func IPv6LinkLocalAllRouters() Addr { return AddrFrom16([16]byte{0: 0xff, 1: 0x02, 15: 0x02}) }
netip.go#L83: func IPv6Loopback() Addr { return AddrFrom16([16]byte{15: 0x01}) }
netip.go#L86: func IPv6Unspecified() Addr { return Addr{z: z6noz} }
netip.go#L89: func IPv4Unspecified() Addr { return AddrFrom4([4]byte{}) }
netip.go#L92: func AddrFrom4(addr [4]byte) Addr {
netip.go#L93: return Addr{
netip.go#L102: func AddrFrom16(addr [16]byte) Addr {
netip.go#L103: return Addr{
netip.go#L115: func ParseAddr(s string) (Addr, error) {
netip.go#L125: return Addr{}, parseAddrError{in: s, msg: "missing IPv6 address"}
netip.go#L128: return Addr{}, parseAddrError{in: s, msg: "unable to parse IP"}
netip.go#L133: func MustParseAddr(s string) Addr {
netip.go#L196: func parseIPv4(s string) (ip Addr, err error) {
netip.go#L200: return Addr{}, err
netip.go#L206: func parseIPv6(in string) (Addr, error) {
netip.go#L219: return Addr{}, parseAddrError{in: in, msg: "zone must be a non-empty string"}
netip.go#L256: return Addr{}, parseAddrError{in: in, msg: "each group must have 4 or less digits", at: s}
netip.go#L260: return Addr{}, parseAddrError{in: in, msg: "IPv6 field has value >=2^16", at: s}
netip.go#L265: return Addr{}, parseAddrError{in: in, msg: "each colon-separated field must have at least one digit", at: s}
netip.go#L272: return Addr{}, parseAddrError{in: in, msg: "embedded IPv4 address must replace the final 2 fields of the address", at: s}
netip.go#L276: return Addr{}, parseAddrError{in: in, msg: "too many hex fields to fit an embedded IPv4 at the end of the address", at: s}
netip.go#L285: return Addr{}, err
netip.go#L305: return Addr{}, parseAddrError{in: in, msg: "unexpected character, want colon", at: s}
netip.go#L307: return Addr{}, parseAddrError{in: in, msg: "colon must be followed by more characters", at: s}
netip.go#L314: return Addr{}, parseAddrError{in: in, msg: "multiple :: in address", at: s}
netip.go#L326: return Addr{}, parseAddrError{in: in, msg: "trailing garbage after address", at: s}
netip.go#L332: return Addr{}, parseAddrError{in: in, msg: "address string too short"}
netip.go#L341: return Addr{}, parseAddrError{in: in, msg: "the :: must expand to at least one field of zeros"}
netip.go#L349: func AddrFromSlice(slice []byte) (ip Addr, ok bool) {
netip.go#L356: return Addr{}, false
netip.go#L361: func (ip Addr) v4(i uint8) uint8 {
netip.go#L367: func (ip Addr) v6(i uint8) uint8 {
netip.go#L373: func (ip Addr) v6u16(i uint8) uint16 {
netip.go#L382: func (ip Addr) isZero() bool {
netip.go#L391: func (ip Addr) IsValid() bool { return ip.z != z0 }
netip.go#L398: func (ip Addr) BitLen() int {
netip.go#L409: func (ip Addr) Zone() string {
netip.go#L419: func (ip Addr) Compare(ip2 Addr) int {
netip.go#L456: func (ip Addr) Less(ip2 Addr) bool { return ip.Compare(ip2) == -1 }
netip.go#L461: func (ip Addr) Is4() bool {
netip.go#L466: func (ip Addr) Is4In6() bool {
netip.go#L472: func (ip Addr) Is6() bool {
netip.go#L480: func (ip Addr) Unmap() Addr {
netip.go#L490: func (ip Addr) WithZone(zone string) Addr {
netip.go#L504: func (ip Addr) withoutZone() Addr {
netip.go#L513: func (ip Addr) hasZone() bool {
netip.go#L518: func (ip Addr) IsLinkLocalUnicast() bool {
netip.go#L537: func (ip Addr) IsLoopback() bool {
netip.go#L556: func (ip Addr) IsMulticast() bool {
netip.go#L576: func (ip Addr) IsInterfaceLocalMulticast() bool {
netip.go#L586: func (ip Addr) IsLinkLocalMulticast() bool {
netip.go#L613: func (ip Addr) IsGlobalUnicast() bool {
netip.go#L639: func (ip Addr) IsPrivate() bool {
netip.go#L666: func (ip Addr) IsUnspecified() bool {
netip.go#L675: func (ip Addr) Prefix(b int) (Prefix, error) {
netip.go#L702: func (ip Addr) As16() (a16 [16]byte) {
netip.go#L711: func (ip Addr) As4() (a4 [4]byte) {
netip.go#L723: func (ip Addr) AsSlice() []byte {
netip.go#L741: func (ip Addr) Next() Addr {
netip.go#L746: return Addr{}
netip.go#L751: return Addr{}
netip.go#L759: func (ip Addr) Prev() Addr {
netip.go#L762: return Addr{}
netip.go#L765: return Addr{}
netip.go#L783: func (ip Addr) String() string {
netip.go#L800: func (ip Addr) AppendTo(b []byte) []byte {
netip.go#L854: func (ip Addr) string4() string {
netip.go#L861: func (ip Addr) appendTo4(ret []byte) []byte {
netip.go#L872: func (ip Addr) string4In6() string {
netip.go#L879: func (ip Addr) appendTo4In6(ret []byte) []byte {
netip.go#L894: func (ip Addr) string6() string {
netip.go#L908: func (ip Addr) appendTo6(ret []byte) []byte {
netip.go#L944: func (ip Addr) StringExpanded() string {
netip.go#L972: func (ip Addr) MarshalText() ([]byte, error) {
netip.go#L997: func (ip *Addr) UnmarshalText(text []byte) error {
netip.go#L999: *ip = Addr{}
netip.go#L1007: func (ip Addr) marshalBinaryWithTrailingBytes(trailingBytes int) []byte {
netip.go#L1029: func (ip Addr) MarshalBinary() ([]byte, error) {
netip.go#L1035: func (ip *Addr) UnmarshalBinary(b []byte) error {
netip.go#L1039: *ip = Addr{}
netip.go#L1056: ip Addr
netip.go#L1062: func AddrPortFrom(ip Addr, port uint16) AddrPort { return AddrPort{ip: ip, port: port} }
netip.go#L1065: func (p AddrPort) Addr() Addr { return p.ip }
netip.go#L1246: var addr Addr
netip.go#L1260: ip Addr
netip.go#L1275: func PrefixFrom(ip Addr, bits int) Prefix {
netip.go#L1287: func (p Prefix) Addr() Addr { return p.ip }
netip.go#L1399: func (p Prefix) Contains(ip Addr) bool {
netip.go#L1535: var addr Addr
net
addrselect.go#L21: func sortByRFC6724withSrcs(addrs []IPAddr, srcs []netip.Addr) {
addrselect.go#L43: func srcAddrs(addrs []IPAddr) []netip.Addr {
addrselect.go#L44: srcs := make([]netip.Addr, len(addrs))
addrselect.go#L66: func ipAttrOf(ip netip.Addr) ipAttr {
addrselect.go#L81: srcs []netip.Addr // or not valid addr if unreachable
addrselect.go#L291: func (t policyTable) Classify(ip netip.Addr) policyTableEntry {
addrselect.go#L316: func classifyScope(ip netip.Addr) scope {
addrselect.go#L343: func commonPrefixLen(a netip.Addr, b IP) (cpl int) {
lookup.go#L257: func (r *Resolver) LookupNetIP(ctx context.Context, network, host string) ([]netip.Addr, error) {
lookup.go#L266: ret := make([]netip.Addr, 0, len(ips))
udpsock_posix.go#L73: var ip netip.Addr
 |
The pages are generated with Golds v0.7.6. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |