url

package
v0.65.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Overview

Package url contains some helper functions to deal with URLs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CutOffPrefix

func CutOffPrefix(input string, prefix string) string

CutOffPrefix simply cuts off a prefix from a string. It returns the original input string when it doesn't start with the prefix.

func CutOffSchema

func CutOffSchema(input string) string

CutOffSchema cuts off the schema part of a URL. For example: https://www.google.com would become www.google.com

func CutOffSuffix

func CutOffSuffix(input string, suffix string) string

CutOffSuffix simply cuts off a suffix from a string. It returns the original input string when it doesn't start with the suffix.

func GetRelativePath

func GetRelativePath(path string) string

GetRelativePath returns the relative path part of a URL. It can handle both full URLs (with a schema) or just absolute paths. For example:

Types

This section is empty.

Jump to

Keyboard shortcuts

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