service

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 23 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ParamsType  = "params"
	FormsType   = "forms"
	HeadersType = "headers"
)

Variables

This section is empty.

Functions

func ByteToStream

func ByteToStream(data []byte) io.Reader

func CheckToken

func CheckToken(c *fiber.Ctx) error

func CreateFile

func CreateFile(file []byte) (*os.File, error)

func DownloadFile

func DownloadFile(filepath string, url string) error

func GetBool

func GetBool(key string) bool

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 GetEnv

func GetEnv(key string) string

func GetWidthAndHeight

func GetWidthAndHeight(c *fiber.Ctx, requestType string) (bool, uint, uint)

func ImageToByte

func ImageToByte(img string) []byte

func ImagickFormat

func ImagickFormat(image []byte) (error, string)

func ImagickGetWidthHeight

func ImagickGetWidthHeight(image []byte) (error, uint, uint)

func ImagickResize

func ImagickResize(image []byte, targetWidth, targetHeight uint) []byte

func IsImageFile

func IsImageFile(filename string) bool

func IsInt

func IsInt(one, two string) bool

func MinioClient

func MinioClient() *minio.Client

func RandomName

func RandomName(length int) string

func RatioWidthHeight

func RatioWidthHeight(width, height, targetWidth, targetHeight uint) (uint, uint)

func Response

func Response(c *fiber.Ctx, code int, status bool, message string, result any) error

func SetWidthToHeight

func SetWidthToHeight(width, height string) (string, string)

func StreamToByte

func StreamToByte(stream io.Reader) []byte

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

Jump to

Keyboard shortcuts

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