normalizeurl

package module
v0.0.0-...-c2b8a31 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2015 License: MIT Imports: 4 Imported by: 1

README

go-normalize-url Build Status

URL normalization tool for Go

Useful when you need to display, store, deduplicate, sort, compare, etc, URLs.

Install

$ go get github.com/sekimura/go-nomalize-url

Usage

package main

import (
    "github.com/sekimura/go-normalize-url"
)

func main () {
    s, _ := normalizeurl.Normalize("sekimura.org")
    println(s)
    //=> http://sekimura.org

    s, _ = normalizeurl.Normalize("HTTP://xn--xample-hva.com:80/?b=bar&a=foo")
    println(s)
    //=> http://êxample.com/?a=foo&b=bar
}

License

MIT © Masayoshi Sekimura

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultPorts = map[string]int{
		"http":  80,
		"https": 443,
		"ftp":   21,
	}
)

Functions

func Normalize

func Normalize(s string) (string, error)

Normalize url strings http://en.wikipedia.org/wiki/URL_normalization

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL