Documentation
¶
Index ¶
- Constants
- func ByteSize(bytes uint64) string
- func ConvertToBytes(humanReadableString string) int
- func CopyBytes(b []byte) []byte
- func CopyString(s string) string
- func EqualFold[S byteSeq](b, s S) bool
- func FunctionName(fn any) string
- func GetArgument(arg string) bool
- func GetMIME(extension string) (mime string)
- func IncrementIPRange(ip net.IP)
- func ParseVendorSpecificContentType(cType string) string
- func StatusMessage(status int) string
- func ToLower(b string) string
- func ToLowerBytes(b []byte) []byte
- func ToString(arg any, timeFormat ...string) string
- func ToUpper(b string) string
- func ToUpperBytes(b []byte) []byte
- func UUID() string
- func UUIDv4() string
- func UnsafeBytes(s string) (bs []byte)
- func UnsafeString(b []byte) string
- type JSONMarshal
- type JSONUnmarshal
- type XMLMarshal
Constants ¶
const MIMEOctetStream = "application/octet-stream"
Variables ¶
This section is empty.
Functions ¶
func ByteSize ¶ added in v0.0.7
ByteSize returns a human-readable byte string of the form 10M, 12.5K, and so forth. The unit that results in the smallest number greater than or equal to 1 is always chosen.
func ConvertToBytes ¶ added in v1.0.0
ConvertToBytes returns integer size of bytes from human-readable string, ex. 42kb, 42M Returns 0 if string is unrecognized
func CopyString ¶ added in v1.0.0
CopyString copies a string to make it immutable
func EqualFold ¶ added in v1.0.0
func EqualFold[S byteSeq](b, s S) bool
EqualFold tests ascii strings or bytes for equality case-insensitively
func FunctionName ¶ added in v0.0.6
FunctionName returns function name
func IncrementIPRange ¶ added in v1.0.0
IncrementIPRange Find available next IP address
func ParseVendorSpecificContentType ¶ added in v1.0.0
ParseVendorSpecificContentType check if content type is vendor specific and if it is parsable to any known types. If its not vendor specific then returns the original content type.
func StatusMessage ¶ added in v0.0.2
StatusMessage returns the correct message for the provided HTTP statuscode
func ToLowerBytes ¶
ToLowerBytes converts ascii slice to lower-case in-place.
func ToUpperBytes ¶
ToUpperBytes converts ascii slice to upper-case in-place.
func UUID ¶ added in v0.0.4
func UUID() string
UUID generates an universally unique identifier (UUID)
func UUIDv4 ¶ added in v1.0.0
func UUIDv4() string
UUIDv4 returns a Random (Version 4) UUID. The strength of the UUIDs is based on the strength of the crypto/rand package.
func UnsafeBytes ¶ added in v0.1.0
#nosec G103 UnsafeBytes returns a byte pointer without allocation
func UnsafeString ¶ added in v0.1.0
#nosec G103 UnsafeString returns a string pointer without allocation
Types ¶
type JSONMarshal ¶ added in v1.0.0
JSONMarshal returns the JSON encoding of v.
type JSONUnmarshal ¶ added in v1.0.0
JSONUnmarshal parses the JSON-encoded data and stores the result in the value pointed to by v. If v is nil or not a pointer, Unmarshal returns an InvalidUnmarshalError.
type XMLMarshal ¶ added in v1.0.0
XMLMarshal returns the XML encoding of v.