helpers

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToUUID added in v1.2.6

func ConvertToUUID(dataString string) uuid.UUID

func CreateError

func CreateError(message string) error

CreateError returns a new error with the given message

func GetENVValue

func GetENVValue(key string) string

GetValue loads the environment variable value for a given key (case insensitive, converts input key to UPPER_SNAKE_CASE), including those loaded from .env file.

func GetFileType added in v1.2.6

func GetFileType(filename string) string

Function to determine if the file is an image or video

func GetQueryUUID added in v1.2.6

func GetQueryUUID(request *http.Request) uuid.UUID

func GetSearchKeyword added in v1.2.6

func GetSearchKeyword(request *http.Request) string

func GetStringContextData added in v1.2.6

func GetStringContextData(request *http.Request, key models.ContextKey) string

func GetUUIDContextData added in v1.2.6

func GetUUIDContextData(request *http.Request, key models.ContextKey) uuid.UUID

func IsValidUUID added in v1.3.0

func IsValidUUID(providedID string) bool

func IsZeroUUID added in v1.3.0

func IsZeroUUID(ID uuid.UUID) bool

func NormalizePhoneNumber added in v1.2.6

func NormalizePhoneNumber(phoneNumber string, toNormal bool) string

func RespondWithJSON

func RespondWithJSON(Response http.ResponseWriter, StatusCode int, Payload interface{})

RespondWithJSON writes a JSON response to the HTTP response writer. Constructs a standardized server response with payload and success flag. Sets the appropriate headers, status code, and writes the JSON data.

Types

This section is empty.

Jump to

Keyboard shortcuts

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