Documentation
¶
Index ¶
- Constants
- Variables
- func AESDecrypt(encryptedString string) (decryptedString string, err error)
- func AESEncrypt(stringToEncrypt string) (encryptedString string, err error)
- func GetExtensions(filename string) string
- func RenderEmailTemplate(templatePath string, data interface{}) (string, error)
- func SendMail(toEmail string, subject string, body string) error
- func UploadFile(file *multipart.FileHeader, path string) error
- func UploadToImageKit(file multipart.File, header *multipart.FileHeader, folder string) (string, error)
- func ValidateImageFile(header *multipart.FileHeader) error
- type EmptyObj
- type Response
Constants ¶
View Source
const (
// todo
KEY = "8e71bbce7451ba2835de5aea73e4f3f96821455240823d2fd8174975b8321bfc!"
)
View Source
const PATH = "assets"
Variables ¶
View Source
var ( ErrFileTooLarge = errors.New("file size exceeds maximum limit of 5MB") ErrFileTypeNotAllowed = errors.New("file type is not allowed") )
Functions ¶
func AESDecrypt ¶
func AESEncrypt ¶
func GetExtensions ¶
func RenderEmailTemplate ¶
func UploadFile ¶
func UploadFile(file *multipart.FileHeader, path string) error
func UploadToImageKit ¶
func UploadToImageKit(file multipart.File, header *multipart.FileHeader, folder string) (string, error)
UploadToImageKit uploads a file to ImageKit and returns the public URL. Requires IMAGEKIT_PRIVATE_KEY env variable to be set. SDK reads IMAGEKIT_PRIVATE_KEY from environment by default.
func ValidateImageFile ¶
func ValidateImageFile(header *multipart.FileHeader) error
Types ¶
Click to show internal directories.
Click to hide internal directories.