honeycombio/urlshaper

Name: urlshaper

Owner: Honeycomb

Description: null

Created: 2016-09-21 20:32:40.0

Updated: 2018-02-12 19:28:09.0

Pushed: 2017-03-02 20:20:28.0

Homepage: null

Size: 11

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

urlshaper

URL Shaper is a go library that takes a URL path and query and breaks it up into its components and creates a shape.

URL Shaper will generate a URL Shape by taking a URL and making a number of changes to it to make it easier to do analysis on URL patterns:

In addition to the URL shape, the Result object you get back from URL Shaper contains

Parameters in the path portion of the URL are identified by matching the URL against a list of provided patterns. Patterns are matched in the order provided; the first match wins. Patterns should represent the entire path portion of the URL - include a “*” at the end to match arbitrary additional segments.

Examples
Query parameters:

input:

output:

REST:

input:

output:

REST & Query parameters:

input:

output:

Unmatched:

input:

output:

Wildcard:

input:

-path /docs/quickstart/linux -pattern /docs/:section/*

output:


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.