Documentation ¶
Index ¶
- Constants
- func ByteToStream(data []byte) io.Reader
- func CheckToken(c *fiber.Ctx) error
- func CreateFile(file []byte) (*os.File, error)
- func DownloadFile(filepath string, url string) error
- func GetBool(key string) bool
- func GetEnv(key string) string
- func GetWidthAndHeight(c *fiber.Ctx, requestType string) (bool, uint, uint)
- func ImageToByte(img string) []byte
- func ImagickFormat(image []byte) (error, string)
- func ImagickGetWidthHeight(image []byte) (error, uint, uint)
- func ImagickResize(image []byte, targetWidth, targetHeight uint) []byte
- func IsImageFile(filename string) bool
- func IsInt(one, two string) bool
- func MinioClient() *minio.Client
- func RandomName(length int) string
- func RatioWidthHeight(width, height, targetWidth, targetHeight uint) (uint, uint)
- func Response(c *fiber.Ctx, code int, status bool, message string, result any) error
- func SetWidthToHeight(width, height string) (string, string)
- func StreamToByte(stream io.Reader) []byte
- type AwsService
Constants ¶
View Source
const ( ParamsType = "params" FormsType = "forms" HeadersType = "headers" )
Variables ¶
This section is empty.
Functions ¶
func ByteToStream ¶
func CheckToken ¶
func CheckToken(c *fiber.Ctx) error
func DownloadFile ¶
func GetBool ¶
GetBool fetches an env var meant to be a bool and follows this logic to determine the value of that bool: if "", return false strconv.ParseBool() otherwise: if that errors, exit; otherwise return the value
func GetWidthAndHeight ¶
func ImageToByte ¶
func ImagickFormat ¶
func ImagickResize ¶
func IsImageFile ¶
func MinioClient ¶
func MinioClient() *minio.Client
func RandomName ¶
func RatioWidthHeight ¶
func SetWidthToHeight ¶
func StreamToByte ¶
Types ¶
type AwsService ¶
type AwsService interface { GlacierVaultList() *glacier.ListVaultsOutput GlacierUploadArchive(vaultName string, fileBuffer []byte) (*glacier.UploadArchiveOutput, error) S3PutObject(bucketName string, objectName string, fileBuffer io.Reader) (*manager.UploadOutput, error) ListBuckets() ([]types.Bucket, error) BucketExists(bucketName string) bool DeleteObjects(bucketName string, objectKeys []string) error }
func NewAwsService ¶
func NewAwsService() AwsService
Click to show internal directories.
Click to hide internal directories.