path

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package path provides helper functions for handling url path

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Escape

func Escape(path string) string

Escape escapes the string, so it can be safely placed inside a URL path segment

url.PathEscape will encode "/" to "%2F", but go-restful will decode it to "/" and return 405 error. so should replace special characters (including /) with %XX sequences first.

func Format

func Format(tmpl string, params ...string) string

Format formats the path with the given parameters escape the path parameters automatically

func Parameter

func Parameter(request *restful.Request, key string) string

Parameter gets the path parameter from the request

Types

This section is empty.

Jump to

Keyboard shortcuts

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