utils

package
v0.0.1-beta.9 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile

func Compile(str string) (regex *regexp.Regexp, keys []string, err error)

Pre-compile pattern/string to avoid runtime or every request execution. Also, it returns keys, which are used in pattern, if any.

func Exec

func Exec(regex *regexp.Regexp, keys []string, uri []byte) (params map[string]string)

On URL path match, map every keys with pattern values

func TrimSuffix

func TrimSuffix(s, suffix string) string

Trim last occurrence of string

Types

This section is empty.

Jump to

Keyboard shortcuts

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