net

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Overview

Package net contains some generic tools and helpers that are missing from the go's standard library

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsIP

func ContainsIP(slice []net.IP, s net.IP) bool

ContainsIP checks if a IP slice contains the IP

func IPNetFromAddrWithMask

func IPNetFromAddrWithMask(addr net.Addr) (net.IPNet, error)

IPNetFromAddrWithMask converts from net.Addr with address in CIDR notation ("w.y.z.x/mm") into net.IPNet with IP and Mask

func IPSliceFromStrings

func IPSliceFromStrings(addresses []string) []net.IP

IPSliceFromStrings takes a slice of strings representing IP addresses and converts them into a slice of net.IP

func Merge

func Merge(first, second []net.IP) []net.IP

Merge adds all elements from second not existing in first to first and returns the resulting slice

func StringSliceFromIPs

func StringSliceFromIPs(addresses []net.IP) []string

StringSliceFromIPs takes a slice of net.IP representing IP addresses and converts them into a slice of strings

func TryRemove

func TryRemove(set []net.IP, ip net.IP) []net.IP

TryRemove removes all occurrences of ip from set and returns the resulting slice

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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