util

package
v1.17.0-go1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 11 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendTimeSecond added in v1.15.1

func AppendTimeSecond(buf []byte, t time.Time) []byte

func AsciiToLowerCase added in v1.4.2

func AsciiToLowerCase(input string) string

func ByteToHex added in v1.13.7

func ByteToHex(b byte) (high, low byte)

func CleanUrlPath

func CleanUrlPath(urlPath string) string

func CompareNumInFilename added in v1.8.0

func CompareNumInFilename(prev, next []byte) (less, ok bool)

func Contains

func Contains(collection []string, find string) bool

func EscapeControllingRune added in v1.13.7

func EscapeControllingRune(str string) []byte

func ExtractHostFromUrl added in v1.15.0

func ExtractHostFromUrl(url string) string

func ExtractHostnamePort added in v1.9.0

func ExtractHostnamePort(host string) (hostname, port string)

func ExtractHostsFromUrls added in v1.15.0

func ExtractHostsFromUrls(urls []string) []string

func ExtractListenPort added in v1.9.0

func ExtractListenPort(listen string) string

func FormatTimeSecond

func FormatTimeSecond(t time.Time) string

func GetBoolEnv added in v1.13.0

func GetBoolEnv(key string) bool

func GetContentType added in v1.11.0

func GetContentType(filename string, rd io.Reader) (string, error)

func GetTTYFile added in v1.13.0

func GetTTYFile() (file *os.File, teardown func() error)

func HasFsPrefixDir

func HasFsPrefixDir(fsPath, prefix string) bool

func HasUrlPrefixDir

func HasUrlPrefixDir(urlPath, prefix string) bool

func InPlaceDedup added in v1.16.0

func InPlaceDedup(inputs []string) []string

func IsDigits

func IsDigits(input string) bool

func IsPathEqual added in v1.15.0

func IsPathEqual(a, b string) bool

func NormalizeUrlPath added in v1.15.0

func NormalizeUrlPath(input string) (string, error)

func SplitFilename

func SplitFilename(filename string) (prefix, suffix string)

func WildcardToStrRegexp added in v1.15.1

func WildcardToStrRegexp(wildcard string) string

Types

type StrEqualFunc added in v1.13.0

type StrEqualFunc func(a, b string) bool

Jump to

Keyboard shortcuts

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