package utils

Import Path
	github.com/gofiber/fiber/v2/utils (on go.dev)

Dependency Relation
	imports 23 packages, and imported by one package


Package-Level Type Names (total 3)
/* sort by: | */
JSONMarshal returns the JSON encoding of v. func github.com/gofiber/fiber/v2.(*Agent).JSONEncoder(jsonEncoder JSONMarshal) *fiber.Agent
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. func github.com/gofiber/fiber/v2.(*Agent).JSONDecoder(jsonDecoder JSONUnmarshal) *fiber.Agent
XMLMarshal returns the XML encoding of v.
Package-Level Functions (total 34)
AssertEqual checks if values are equal
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.
ConvertToBytes returns integer size of bytes from human-readable string, ex. 42kb, 42M Returns 0 if string is unrecognized
CopyBytes copies a slice to make it immutable
CopyString copies a string to make it immutable
EqualFold tests ascii strings for equality case-insensitively
EqualFoldBytes tests ascii slices for equality case-insensitively
FunctionName returns function name
GetArgument check if key is in arguments
Deprecated: Please use UnsafeBytes instead
GetMIME returns the content-type of a file extension
Deprecated: Please use UnsafeString instead
Deprecated: Please use CopyString instead
IncrementIPRange Find available next IP address
IsIPv4 works the same way as net.ParseIP, but without check for IPv6 case and without returning net.IP slice, whereby IsIPv4 makes no allocations.
IsIPv6 works the same way as net.ParseIP, but without check for IPv4 case and without returning net.IP slice, whereby IsIPv6 makes no allocations.
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.
StartTimeStampUpdater starts a concurrent function which stores the timestamp to an atomic value per second, which is much better for performance than determining it at runtime each time
StatusMessage returns the correct message for the provided HTTP statuscode
ToLower converts ascii string to lower-case
ToLowerBytes converts ascii slice to lower-case in-place.
ToString Change arg to string
ToUpper converts ascii string to upper-case
ToUpperBytes converts ascii slice to upper-case in-place.
Trim is the equivalent of strings.Trim
TrimBytes is the equivalent of bytes.Trim
TrimLeft is the equivalent of strings.TrimLeft
TrimLeftBytes is the equivalent of bytes.TrimLeft
TrimRight is the equivalent of strings.TrimRight
TrimRightBytes is the equivalent of bytes.TrimRight
UnsafeBytes returns a byte pointer without allocation.
UnsafeString returns a string pointer without allocation
UUID generates an universally unique identifier (UUID)
UUIDv4 returns a Random (Version 4) UUID. The strength of the UUIDs is based on the strength of the crypto/rand package.
Package-Level Variables (only one)
Timestamp please start the timer function before you use this value please load the value with atomic `atomic.LoadUint32(&utils.Timestamp)`
Package-Level Constants (only one)
const MIMEOctetStream = "application/octet-stream"