No Description

Leonardo Di Donato a0f5013415 update: new go versions (CI) 5 years ago
docs 51b0ce7df3 docs: introducing FSM image and dot file for URN grammar 5 years ago
.gitignore b2cb0c620d build: go modules support 5 years ago
.travis.yml a0f5013415 update: new go versions (CI) 5 years ago
LICENSE a67a23e1c1 Update: Explicitly test for go 1.11.x too 6 years ago
README.md 70078a794e Docs: Simplify installation section 6 years ago
go.mod b2cb0c620d build: go modules support 5 years ago
go.sum b2cb0c620d build: go modules support 5 years ago
machine.go 964cd56655 update: better formatted generated Go code 5 years ago
machine.go.rl 2f42d4d079 New: Store and normalize specific string only when really needed 6 years ago
machine_test.go 267ab4a24b Update: Testing also URN LEX instances 6 years ago
makefile 377b1bad12 build: gen image and dot files 5 years ago
performance_test.go 267ab4a24b Update: Testing also URN LEX instances 6 years ago
tables_test.go 0bf015dead New: Testing table for URN LEX 6 years ago
urn.go 203993f3e7 Update: Urn struct 6 years ago
urn_test.go 43608851b1 Docs: Performances section 6 years ago

README.md

Build Coverage Documentation

A parser for URNs.

As seen on RFC 2141.

API documentation.

Installation

go get github.com/leodido/go-urn

Performances

This implementation results to be really fast.

Usually below ½ microsecond on my machine1.

Notice it also performs, while parsing:

  1. fine-grained and informative erroring
  2. specific-string normalization

    ok/00/urn:a:b______________________________________/-4      20000000      265 ns/op      182 B/op      6 allocs/op
    ok/01/URN:foo:a123,456_____________________________/-4      30000000      296 ns/op      200 B/op      6 allocs/op
    ok/02/urn:foo:a123%2c456___________________________/-4      20000000      331 ns/op      208 B/op      6 allocs/op
    ok/03/urn:ietf:params:scim:schemas:core:2.0:User___/-4      20000000      430 ns/op      280 B/op      6 allocs/op
    ok/04/urn:ietf:params:scim:schemas:extension:enterp/-4      20000000      411 ns/op      312 B/op      6 allocs/op
    ok/05/urn:ietf:params:scim:schemas:extension:enterp/-4      20000000      472 ns/op      344 B/op      6 allocs/op
    ok/06/urn:burnout:nss______________________________/-4      30000000      257 ns/op      192 B/op      6 allocs/op
    ok/07/urn:abcdefghilmnopqrstuvzabcdefghilm:x_______/-4      20000000      375 ns/op      213 B/op      6 allocs/op
    ok/08/urn:urnurnurn:urn____________________________/-4      30000000      265 ns/op      197 B/op      6 allocs/op
    ok/09/urn:ciao:@!=%2c(xyz)+a,b.*@g=$_'_____________/-4      20000000      307 ns/op      248 B/op      6 allocs/op
    ok/10/URN:x:abc%1dz%2f%3az_________________________/-4      30000000      259 ns/op      212 B/op      6 allocs/op
    no/11/URN:-xxx:x___________________________________/-4      20000000      445 ns/op      320 B/op      6 allocs/op
    no/12/urn::colon:nss_______________________________/-4      20000000      461 ns/op      320 B/op      6 allocs/op
    no/13/urn:abcdefghilmnopqrstuvzabcdefghilmn:specifi/-4      10000000      660 ns/op      320 B/op      6 allocs/op
    no/14/URN:a!?:x____________________________________/-4      20000000      507 ns/op      320 B/op      6 allocs/op
    no/15/urn:urn:NSS__________________________________/-4      20000000      429 ns/op      288 B/op      6 allocs/op
    no/16/urn:white_space:NSS__________________________/-4      20000000      482 ns/op      320 B/op      6 allocs/op
    no/17/urn:concat:no_spaces_________________________/-4      20000000      539 ns/op      328 B/op      7 allocs/op
    no/18/urn:a:/______________________________________/-4      20000000      470 ns/op      320 B/op      7 allocs/op
    no/19/urn:UrN:NSS__________________________________/-4      20000000      399 ns/op      288 B/op      6 allocs/op
    

  • [1]: Intel Core i7-7600U CPU @ 2.80GHz

Analytics