utils

package
v0.0.0-...-389710c Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// The AES key should be a valid hexadecimal string.
	// For AES-256, it needs to be 32 bytes, which is 64 hexadecimal characters.
	// Removed the '!' character which was causing the encoding/hex error.
	KEY = "8e71bbce7451ba2835de5aea73e4f3f96821455240823d2fd8174975b8321bfc"
)
View Source
const PATH = "assets"

Variables

This section is empty.

Functions

func AESDecrypt

func AESDecrypt(encryptedString string) (decryptedString string, err error)

func AESEncrypt

func AESEncrypt(stringToEncrypt string) (encryptedString string, err error)

func GetExtensions

func GetExtensions(filename string) string

func SendMail

func SendMail(toEmail string, subject string, body string) error

func UploadFile

func UploadFile(file *multipart.FileHeader, path string) error

Types

type EmptyObj

type EmptyObj struct{}

type Response

type Response struct {
	Status  bool   `json:"status"`
	Message string `json:"message"`
	Error   any    `json:"error,omitempty"`
	Data    any    `json:"data,omitempty"`
	Meta    any    `json:"meta,omitempty"`
}

func BuildResponseFailed

func BuildResponseFailed(message string, err string, data any) Response

func BuildResponseSuccess

func BuildResponseSuccess(message string, data any) Response

Jump to

Keyboard shortcuts

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