mask

package
Version: v0.0.0-...-ce94876 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2019 License: MIT, MIT Imports: 4 Imported by: 0

README

go-multiaddr-filter -- CIDR netmasks with multiaddr

This module creates very simple multiaddr formatted cidr netmasks.

It doesn't do full multiaddr parsing to save on vendoring things and perf. The net package will take care of verifying the validity of the network part anyway.

Usage


import filter "github.com/whyrusleeping/multiaddr-filter"

filter.NewMask("/ip4/192.168.0.0/24") // ipv4
filter.NewMask("/ip6/fe80::/64") // ipv6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidFormat = errors.New("invalid multiaddr-filter format")

Functions

func ConvertIPNet

func ConvertIPNet(n *net.IPNet) (string, error)

func NewMask

func NewMask(a string) (*net.IPNet, error)

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL