cidr

package
v1.14.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Overview

Package cidr provides common functions useful when working with Classless Inter-Domain Routing (CIDR)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BroadcastAddress

func BroadcastAddress(ipNet *net.IPNet) net.IP

BroadcastAddress returns the last IP address of an IP network

func NetworkAddress

func NetworkAddress(ipNet *net.IPNet) net.IP

NetworkAddress teturns the first IP address of an IP network

Types

type Groups added in v1.6.0

type Groups [][]*net.IPNet

Groups allows parsing cidr groups. Example: [v1, v2, v3], [v4], v5 =>

 [][]*net.IPNet{
		{v1, v2, v3},
		{v4},
		{v5},
	}

Can be used for env configuration. See at https://github.com/kelseyhightower/envconfig#custom-decoders

func (*Groups) Decode added in v1.6.0

func (g *Groups) Decode(value string) error

Decode parses values from passed string.

Jump to

Keyboard shortcuts

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