netip

package
v0.0.0-...-fab57c2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package netip provides a mockable wrapper for net/netip.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Impl

type Impl struct{}

func (*Impl) AddrFrom16

func (*Impl) AddrFrom16(addr [16]byte) netip.Addr

func (*Impl) AddrFrom4

func (*Impl) AddrFrom4(addr [4]byte) netip.Addr

func (*Impl) AddrFromSlice

func (*Impl) AddrFromSlice(slice []byte) (ip netip.Addr, ok bool)

func (*Impl) AddrPortFrom

func (*Impl) AddrPortFrom(ip netip.Addr, port uint16) netip.AddrPort

func (*Impl) IPv4Unspecified

func (*Impl) IPv4Unspecified() netip.Addr

func (*Impl) IPv6LinkLocalAllNodes

func (*Impl) IPv6LinkLocalAllNodes() netip.Addr

func (*Impl) IPv6Unspecified

func (*Impl) IPv6Unspecified() netip.Addr

func (*Impl) MustParseAddr

func (*Impl) MustParseAddr(s string) netip.Addr

func (*Impl) MustParseAddrPort

func (*Impl) MustParseAddrPort(s string) netip.AddrPort

func (*Impl) MustParsePrefix

func (*Impl) MustParsePrefix(s string) netip.Prefix

func (*Impl) ParseAddr

func (*Impl) ParseAddr(s string) (netip.Addr, error)

func (*Impl) ParseAddrPort

func (*Impl) ParseAddrPort(s string) (netip.AddrPort, error)

func (*Impl) ParsePrefix

func (*Impl) ParsePrefix(s string) (netip.Prefix, error)

func (*Impl) PrefixFrom

func (*Impl) PrefixFrom(ip netip.Addr, bits int) netip.Prefix

type Interface

type Interface interface {
	AddrFrom16(addr [16]byte) netip.Addr
	AddrFrom4(addr [4]byte) netip.Addr
	AddrFromSlice(slice []byte) (ip netip.Addr, ok bool)
	AddrPortFrom(ip netip.Addr, port uint16) netip.AddrPort
	IPv4Unspecified() netip.Addr
	IPv6LinkLocalAllNodes() netip.Addr
	IPv6Unspecified() netip.Addr
	MustParseAddr(s string) netip.Addr
	MustParseAddrPort(s string) netip.AddrPort
	MustParsePrefix(s string) netip.Prefix
	ParseAddr(s string) (netip.Addr, error)
	ParseAddrPort(s string) (netip.AddrPort, error)
	ParsePrefix(s string) (netip.Prefix, error)
	PrefixFrom(ip netip.Addr, bits int) netip.Prefix
}

Jump to

Keyboard shortcuts

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