urlutil

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2022 License: MIT Imports: 3 Imported by: 25

Documentation

Index

Constants

View Source
const (
	HTTP  = "http"
	HTTPS = "https"

	DefaultHTTPPort  = "80"
	DefaultHTTPSPort = "443"
)

Variables

This section is empty.

Functions

func AppendRequestURI

func AppendRequestURI(u, requestURI string) (string, error)

func ChangePort

func ChangePort(u, port string) (string, error)

func PreprendDefaultScheme

func PreprendDefaultScheme(u string) string

func PreprendScheme

func PreprendScheme(u, scheme string) string

func TrimPort

func TrimPort(host, port string) string

func TrimScheme

func TrimScheme(host string) string

Types

type URL

type URL struct {
	Scheme     string
	Username   string
	Password   string
	Host       string
	Port       string
	RequestURI string
	Fragment   string
}

func Parse

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

func ParseWithScheme

func ParseWithScheme(u string) (*URL, error)

func (URL) String

func (u URL) String() string

Jump to

Keyboard shortcuts

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