utils

package
v0.0.0-...-0874fcc Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AccessKeyID = os.Getenv("AWS_ACCESS_KEY_ID")
View Source
var AwsRegion = os.Getenv("AWS_REGION")
View Source
var SecretAccessKey = os.Getenv("AWS_SECRET_ACCESS_KEY")
View Source
var TWILIO_ACCOUNT_SID string = os.Getenv("TWILIO_ACCOUNT_SID")
View Source
var TWILIO_AUTH_TOKEN string = os.Getenv("TWILIO_AUTH_TOKEN")
View Source
var VERIFY_SERVICE_SID string = os.Getenv("VERIFY_SERVICE_SID")

Functions

func BuildProListeList

func BuildProListeList(m pdf.Maroto, bill model.Invoice)

func BuildTotal

func BuildTotal(total string, m pdf.Maroto)

func CheckComplexityOFPassword

func CheckComplexityOFPassword[T string](password T) bool

func CheckOtp

func CheckOtp(to, code string) bool

func ExtractOrderInfo

func ExtractOrderInfo[T []model.Order, R []model.OrderRespAdmin](order T) R

func ExtractProImage

func ExtractProImage[T []model.ProductImage, R []ProductImageInfo](proImg T) R

func InternalServerError

func InternalServerError(msg string, c *fiber.Ctx) error

func ListenAndShutdown

func ListenAndShutdown(app *fiber.App)

func NewBillGenerator

func NewBillGenerator() I.IBillGenerator

func NewToken

func NewToken() I.IToken

func Payment

func Payment(products string, totalAmount float64) string

func SendOtp

func SendOtp(to string) bool

func SendSMSOTP

func SendSMSOTP(phoneNumber string, otp string) error

func UploadPDFToS3

func UploadPDFToS3[T string](filePath, filname string) (bool, string)

func UploadToBucket

func UploadToBucket(file *multipart.FileHeader) (string, bool, string)

func ValidateStruct

func ValidateStruct[T any](s T) error

func WelcomeMsg

func WelcomeMsg(phoneNumber string) error

Types

type BillGenerator

type BillGenerator struct{}

func (*BillGenerator) GenerateInvoice

func (*BillGenerator) GenerateInvoice(bill model.Invoice) string

type Combine

type Combine struct {
	UserId       int
	Name         string
	Username     string
	Phone        string
	Mail         string
	Verification bool
	Housename    string
	Street       string
	City         string
	Pin          string
	State        string
}

func Combined

func Combined(users []PersonalInformation, addresses []Extractaddress) []Combine

type CombinedProductInfo

type CombinedProductInfo struct {
	ID              int     `json:"id"`
	ProductCategory string  `json:"pro_category"`
	ProductName     string  `json:"pro_name"`
	Price           float64 `json:"price"`
	ImageOne        string  `json:"img_one"`
	ImageTwo        string  `json:"img_two"`
	ImageThree      string  `json:"img_three"`
}

func CombinePRoductAndProductImage

func CombinePRoductAndProductImage(proInfo []ProductInfo, proimageInfo []ProductImageInfo) []CombinedProductInfo

type Extractaddress

type Extractaddress struct {
	UserID    uint
	Housename string
	Street    string
	City      string
	Pin       string
	State     string
}

func ExtractAdresses

func ExtractAdresses(addr []model.Address) []Extractaddress

type PersonalInformation

type PersonalInformation struct {
	UserId       int
	Name         string
	Username     string
	Phone        string
	Mail         string
	Verification bool
}

func ExtractPersonalInfo

func ExtractPersonalInfo(users []model.Users) []PersonalInformation

type ProductImageInfo

type ProductImageInfo struct {
	ProductId  int
	ImageOne   string
	ImageTwo   string
	ImageThree string
}

type ProductInfo

type ProductInfo struct {
	ID              int
	ProductCategory string
	ProductName     string
	Price           float64
}

func ExtractProductInfo

func ExtractProductInfo[T []model.Products](product T) []ProductInfo

Jump to

Keyboard shortcuts

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