Documentation ¶
Overview ¶
Package util provides a set of utility and helper functions for webborer.
Index ¶
- Variables
- func DedupeStrings(s []string) []string
- func DumpStackTrace()
- func EnableCPUProfiling() func()
- func EnableStackTraces() func()
- func GetParentPaths(child *url.URL) []*url.URL
- func StatusCodeGroup(code int) int
- func StringHeader(header http.Header, sep string) string
- func StringSliceContains(haystack []string, needle string) bool
- func URLHasExtension(u *url.URL) bool
- func URLIsDir(u *url.URL) bool
- func URLIsSubpath(parent, child *url.URL) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var StackDumpSignal = syscall.SIGQUIT
Functions ¶
func DumpStackTrace ¶
func DumpStackTrace()
func EnableStackTraces ¶
func EnableStackTraces() func()
Enable stack traces on SIGQUIT Returns a function that can be used to disable stack traces.
func GetParentPaths ¶
Get the parent paths of a given path
func StatusCodeGroup ¶
Find the group (200, 300, 400, 500, ...) this status code belongs to
func StringHeader ¶
Turn an http.Header into a string representation
func StringSliceContains ¶
Does a slice of strings contain a string
func URLHasExtension ¶
func URLIsSubpath ¶
Determine if one path is a subpath of another path Only considers the host and scheme if they are non-empty in the parent Identical paths are considered subpaths of each other
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.