util

package
v0.0.0-...-c15384f Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HasFsPrefixDir = HasFsPrefixDirAccurate
View Source
var HasUrlPrefixDir = HasUrlPrefixDirAccurate
View Source
var IsPathEqual = IsStrEqualAccurate

Functions

func AppendTimeSecond

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

func AsciiToLowerCase

func AsciiToLowerCase(input string) string

func ByteToHex

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

func CleanUrlPath

func CleanUrlPath(urlPath string) string

func CompareNumInFilename

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

func Contains

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

func EscapeControllingRune

func EscapeControllingRune(str string) []byte

func ExtractHostFromUrl

func ExtractHostFromUrl(url string) string

func ExtractHostnamePort

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

func ExtractHostsFromUrls

func ExtractHostsFromUrls(urls []string) []string

func ExtractListenPort

func ExtractListenPort(listen string) string

func FormatTimeSecond

func FormatTimeSecond(t time.Time) string

func GetBoolEnv

func GetBoolEnv(key string) bool

func GetContentType

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

func GetTTYFile

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

func HasFsPrefixDirAccurate

func HasFsPrefixDirAccurate(fsPath, prefix string) bool

func HasFsPrefixDirNoCase

func HasFsPrefixDirNoCase(fsPath, prefix string) bool

func HasUrlPrefixDirAccurate

func HasUrlPrefixDirAccurate(urlPath, prefix string) bool

func HasUrlPrefixDirNoCase

func HasUrlPrefixDirNoCase(urlPath, prefix string) bool

func IsDigits

func IsDigits(input string) bool

func IsStrEqualAccurate

func IsStrEqualAccurate(a, b string) bool

func IsStrEqualNoCase

func IsStrEqualNoCase(a, b string) bool

func NormalizeUrlPath

func NormalizeUrlPath(input string) (string, error)

func SplitFilename

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

func WildcardToStrRegexp

func WildcardToStrRegexp(wildcard string) string

Types

type StrEqualFunc

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