utils

package
v0.0.0-...-58882fa Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDuration

func FormatDuration(d time.Duration) string

FORMAT DURATION

func FormatFileSize

func FormatFileSize(size uint64) string

FORMAT FILE SIZE

func GenerateAudioThumbnail

func GenerateAudioThumbnail(thumbnailPath string) error

func GenerateDocumentThumbnail

func GenerateDocumentThumbnail(thumbnailPath string) error

func GenerateFilename

func GenerateFilename(sourceURL, contentType string) string

GENERATE A FILENAME FOR DOWNLOADED ASSETS

func GenerateGenericThumbnail

func GenerateGenericThumbnail(thumbnailPath string) error

func GenerateHash

func GenerateHash(input string) string

func GenerateID

func GenerateID(prefix string) string

GENERATE A UNIQUE ID WITH PREFIX

func GenerateImageThumbnail

func GenerateImageThumbnail(sourcePath, thumbnailPath string) error

func GenerateVideoThumbnail

func GenerateVideoThumbnail(sourcePath, thumbnailPath string) error

func NormalizeURL

func NormalizeURL(baseURL, relativeURL string) string

func ResolveURL

func ResolveURL(baseURL, relativeURL string) string

RESOLVE RELATIVE URL TO ABSOLUTE

func RespondWithError

func RespondWithError(w http.ResponseWriter, code int, message string)

HTTP RESPONSES

func RespondWithJSON

func RespondWithJSON(w http.ResponseWriter, code int, payload any)

Types

This section is empty.

Jump to

Keyboard shortcuts

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