util

package
v0.0.0-...-c20d51c Latest Latest
Warning

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

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

Documentation

Overview

Package util provides a set of utility and helper functions for webborer.

Index

Constants

This section is empty.

Variables

View Source
var StackDumpSignal = syscall.SIGQUIT

Functions

func DedupeStrings

func DedupeStrings(s []string) []string

Deduplicate a slice of strings

func DumpStackTrace

func DumpStackTrace()

func EnableCPUProfiling

func EnableCPUProfiling() func()

Debug profiling support

func EnableStackTraces

func EnableStackTraces() func()

Enable stack traces on SIGQUIT Returns a function that can be used to disable stack traces.

func GetParentPaths

func GetParentPaths(child *url.URL) []*url.URL

Get the parent paths of a given path

func StatusCodeGroup

func StatusCodeGroup(code int) int

Find the group (200, 300, 400, 500, ...) this status code belongs to

func StringHeader

func StringHeader(header http.Header, sep string) string

Turn an http.Header into a string representation

func StringSliceContains

func StringSliceContains(haystack []string, needle string) bool

Does a slice of strings contain a string

func URLHasExtension

func URLHasExtension(u *url.URL) bool

func URLIsDir

func URLIsDir(u *url.URL) bool

func URLIsSubpath

func URLIsSubpath(parent, child *url.URL) bool

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.

Jump to

Keyboard shortcuts

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