Code Monkey home page Code Monkey logo

netaddr's Introduction

netaddr package for go

This repo contains a library to complement the go net library and provides containers and utilities like in python's netaddr.

Please see the api documentation for details. The authoritative source for this library is found on github. We encourage importing this code using the stable, versioned URL provided by gopkg.in. Once imported, refer to it as netaddr in your code (without the version).

import "gopkg.in/netaddr.v1"

comparison with python's netaddr

This netaddr library was written to complement the existing net package in go just filling in a few gaps that existed. See the table below for a side-by-side comparison of python netaddr features and the corresponding features in this library or elsewhere in go packages.

Python netaddr Go
EUI ???
IPAddress Use IP from net*
IPNetwork Use IPNet from net**
IPSet Use IPSet
IPRange Use [IPRange]
IPGlob Not yet implemented

* The net package in golang parses IPv4 address as IPv4 encoded IPv6 addresses. I found this design choice frustrating. Hence, there is a ParseIP in this package that always parses IPv4 as 4 byte addresses.

** This package provides a few extra convenience utilities for IPNet. See ParseNet, NetSize, BroadcastAddr, and NetworkAddr.

help

This needs a lot of work. Help if you can!

  • More test coverage

netaddr's People

Contributors

ecbaldwin avatar henrygessau avatar smikulcik avatar venamoye avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.