netconv

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package netconv provides utilities to convert between netaddr and netip. To convert from a net.IP, use the netaddr/netip API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsAddr

func AsAddr(a netaddr.IP) netip.Addr

AsAddr returns a as a netip.IP.

func AsAddrPort

func AsAddrPort(a netaddr.IPPort) netip.AddrPort

AsAddrPort returns a as a netip.AddrPort.

func AsIP

func AsIP(a netip.Addr) netaddr.IP

AsIP returns a as a netaddr.IP.

func AsIPPort

func AsIPPort(a netip.AddrPort) netaddr.IPPort

AsIPPort returns a as a netaddr.IPPort.

func AsIPPrefix

func AsIPPrefix(a netip.Prefix) netaddr.IPPrefix

AsIPPrefix returns a as a netaddr.IPPrefix. If a has Bits of -1, indicating an invalid bits, the returned IPPrefix will have Bits of 255. AsIPPrefix and AsPrefix do not round trip for invalid Bits values.

func AsPrefix

func AsPrefix(a netaddr.IPPrefix) netip.Prefix

AsPrefix returns a as a netip.Prefix. If a has an invalid Bits value, the returned Prefix will have Bits of -1. AsIPPrefix and AsPrefix do not round trip for invalid Bits values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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