ipnet

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package ipnet wraps net.IPNet to get CIDR serialization.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPNet

type IPNet struct {
	net.IPNet
}

IPNet wraps net.IPNet to get CIDR serialization.

func MustParseCIDR added in v0.7.0

func MustParseCIDR(s string) *IPNet

MustParseCIDR parses a CIDR from its string representation. If the parse fails, the function will panic.

func ParseCIDR added in v0.7.0

func ParseCIDR(s string) (*IPNet, error)

ParseCIDR parses a CIDR from its string representation.

func (IPNet) MarshalJSON

func (ipnet IPNet) MarshalJSON() (data []byte, err error)

MarshalJSON interface for an IPNet

func (*IPNet) String

func (ipnet *IPNet) String() string

String returns a CIDR serialization of the subnet, or an empty string if the subnet is nil.

func (*IPNet) UnmarshalJSON

func (ipnet *IPNet) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON interface for an IPNet

Jump to

Keyboard shortcuts

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