GithubHelp home page GithubHelp logo

address's Introduction

Emitter address

This golang package is used for IP/hardware address parsing for emitter.io. This provides a simple way of parsing a variety of IP addresses and, in future, domain names.

Join the chat at https://gitter.im/emitter-io/public Build status Coverage Status Go Report Card

Installation

go get -u github.com/emitter-io/address

API Documentation

For full API documentation, please refer to our godoc.org/github.com/emitter-io/address which contains all of the methods that package exposes.

Parsing IP Addresses

Typical usage consists of calling parse function which provides a set of helpers such as (e.g. private, public and external) which then get appropriately parsed to the TCP IP Address, as demonstrated below.

addr, err := address.Parse("external:8080")

address's People

Contributors

gmlewis avatar kelindar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

address's Issues

Unit tests fail on Linux Mint Cinnamon 19.3

I believe that this is related to: emitter-io/emitter#369

$ go version
go version go1.16.5 linux/amd64

$ go test ./...
resolving 
unable to resolve an empty name or url
resolving https://google.com
resolving google.com
resolving google.com/1234/sds
resolving https://127.0.0.1
resolving https://4987e9gs99sxdg8e8e7tgwe5.boomshouldnotwork
lookup 4987e9gs99sxdg8e8e7tgwe5.boomshouldnotwork: no such host
resolving 127.0.0.1
resolving 2001:db8::68
resolving 192.0.2.1
resolving 127.0.0.1:22
resolving 127.0.0.1:8xx0
parse "tcp://127.0.0.1:8xx0": invalid port ":8xx0" after host
resolving tcp://127.0.0.1:8000
resolving https://gooo:oogle.com
parse "https://gooo:oogle.com": invalid port ":oogle.com" after host
resolving https://google.com:xxx
parse "https://google.com:xxx": invalid port ":xxx" after host
resolving https-----:// ://--
parse "https-----:// ://--": invalid character " " in host name
resolving ::
resolving :::
resolving ::::::::
lookup :::::::: no such host
--- FAIL: TestResolve (0.16s)
    dns_test.go:48: 
        	Error Trace:	dns_test.go:48
        	Error:      	Not equal: 
        	            	expected: true
        	            	actual  : false
        	Test:       	TestResolve
address 2603:9001:8d01:f500:1198:e1ce:b639:9949:80: too many colons in address
unable to parse an empty address
address 2603:9001:8d01:f500:1198:e1ce:b639:9949:80: too many colons in address
address 2603:9001:8d01:f500:1198:e1ce:b639:9949:1234: too many colons in address
--- FAIL: TestParse (0.15s)
    ipaddr_test.go:31: 
        	Error Trace:	ipaddr_test.go:31
        	Error:      	Not equal: 
        	            	expected: false
        	            	actual  : true
        	Test:       	TestParse
    ipaddr_test.go:31: 
        	Error Trace:	ipaddr_test.go:31
        	Error:      	Not equal: 
        	            	expected: false
        	            	actual  : true
        	Test:       	TestParse
    ipaddr_test.go:31: 
        	Error Trace:	ipaddr_test.go:31
        	Error:      	Not equal: 
        	            	expected: false
        	            	actual  : true
        	Test:       	TestParse
FAIL
FAIL	github.com/emitter-io/address	0.314s
FAIL

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.