urls

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PathSeparator is the URL paths separator character
	PathSeparator = '/'
)

Variables

This section is empty.

Functions

func Ext

func Ext(path string) string

Ext returns the resource name extension used by URL path. The extension is the suffix beginning at the final dot in the final element of path; it is empty if there is no dot.

Types

type URL

type URL struct {
	*url.URL
	// ResourcePath is the URL Path without the resource
	// name segment
	ResourcePath string
	// The resource name part of the path.
	// If the url is for a resource with extension,
	// such as .html, it is not part of this string.
	// See Extension for the extension segment.
	ResourceName string
	// The resource extension part of the path
	// identified as the last segment after resource
	// name, starting with a dot (.).
	// May be nil (empty string) if the url resource
	// does not specify extension.
	Extension string
}

URL extends the standard url.URL struct with additional fields

func Parse

func Parse(urlString string) (*URL, error)

Parse extends the standard url.Parse to produce urls.URL structure objects

Jump to

Keyboard shortcuts

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