Documentation
¶
Index ¶
- func DetectContentType(filename string, content []byte) string
- func ExtensionByMime(mimeType string) string
- func GenerateSlugBatch(batchSize, length int) ([]string, error)
- func IsDebugEnabled() bool
- func IsTextContent(contentType string) bool
- func IsValidSlug(slug string) bool
- func SecureRandomSlug(length int) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectContentType ¶
DetectContentType attempts to detect the MIME type of content It first tries to detect from the filename, then from the content itself
func ExtensionByMime ¶
ExtensionByMime returns the most common file extension for a given MIME type
func GenerateSlugBatch ¶
GenerateSlugBatch returns a batch of candidate slugs
func IsDebugEnabled ¶
func IsDebugEnabled() bool
IsDebugEnabled returns true unless GIN_MODE=release
func IsTextContent ¶
IsTextContent returns true if the content type is text-based
func IsValidSlug ¶
IsValidSlug checks if a slug contains only valid characters
func SecureRandomSlug ¶
SecureRandomSlug generates a random slug of given length using crypto/rand and a custom charset
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.