urlutil

package
v0.0.0-...-b75375f Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2014 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package urlutil contains utility functions related to URLs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendQuery

func AppendQuery(s string, query url.Values) string

AppendQuery appends the given query string as an url.Values to the given URL. It works correctly even if the URL already has a query string.

func IsURL

func IsURL(s string) bool

IsURL returns true iff s looks like a URL.

func Join

func Join(base string, rel string) (string, error)

Join returns the result of joining the base URL with the rel URL. If either base or rel are not valid URLs, an error will be returned.

func MustJoin

func MustJoin(base string, rel string) string

MustJoin works like Join, but panics if there's an error.

func SameHost

func SameHost(url1, url2 string) bool

SameHost returns true iff both URLs point to the same host. It works for both absolute and relative URLs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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