utils

package
v1.10.91 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const MIMEOctetStream = "application/octet-stream"

Variables

This section is empty.

Functions

func AssertEqual

func AssertEqual(t testing.TB, a, b interface{}, description ...string)

AssertEqual checks if values are equal

func EqualsFold

func EqualsFold(b, s []byte) (equals bool)

EqualFold the equivalent of bytes.EqualFold

func FunctionName

func FunctionName(fn interface{}) string

Returns function name

func GetArgument

func GetArgument(arg string) bool

GetArgument check if key is in arguments

func GetBytes

func GetBytes(s string) (bs []byte)

#nosec G103 GetBytes returns a byte pointer without allocation

func GetCharPos

func GetCharPos(s string, char byte, matchCount int) int

GetCharPos ...

func GetMIME

func GetMIME(extension string) (mime string)

GetMIME returns the content-type of a file extension

func GetString

func GetString(b []byte) string

#nosec G103 GetString returns a string pointer without allocation

func GetTrimmedParam

func GetTrimmedParam(param string) string

GetTrimmedParam trims the ':' & '?' from a string

func ImmutableString

func ImmutableString(s string) string

ImmutableString returns a immutable string with allocation

func StatusMessage

func StatusMessage(status int) string

StatusMessage ...

func ToLower

func ToLower(b string) string

ToLower is the equivalent of strings.ToLower

func ToLowerBytes

func ToLowerBytes(b []byte) []byte

ToLowerBytes is the equivalent of bytes.ToLower

func ToUpper

func ToUpper(b string) string

ToUpper is the equivalent of strings.ToUpper

func ToUpperBytes

func ToUpperBytes(b []byte) []byte

ToUpperBytes is the equivalent of bytes.ToUpper

func Trim

func Trim(s string, cutset byte) string

Trim is the equivalent of strings.Trim

func TrimLeft

func TrimLeft(s string, cutset byte) string

TrimLeft is the equivalent of strings.TrimLeft

func TrimRight

func TrimRight(s string, cutset byte) string

TrimRight is the equivalent of strings.TrimRight

func UUID

func UUID() string

Types

This section is empty.

Jump to

Keyboard shortcuts

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