utils

package
v0.0.0-...-04b1328 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func CalculateTotalAmount

func CalculateTotalAmount(inv models.Invoice) float64

func GenerateInvoice

func GenerateInvoice(invoice models.Invoice) ([]byte, error)

func GenerateSendInvoice

func GenerateSendInvoice(inv models.Invoice, emailData models.EmailData) error

func GetJSON

func GetJSON[T any](client *redis.Client, key string, dest *T) error

func InvalidateKeys

func InvalidateKeys(client *redis.Client, key ...string) error

func SendInvoiceEmail

func SendInvoiceEmail(data models.EmailData, cfg models.SMTConfig, invoicePDF []byte) error

func SendMail

func SendMail(data models.EmailData) error

func SetJSON

func SetJSON(client *redis.Client, key string, data any, ttl time.Duration) error

func VerifyRecaptcha

func VerifyRecaptcha(token string) error

Types

type RecaptchaResponse

type RecaptchaResponse struct {
	Success     bool     `json:"success"`
	Score       float64  `json:"score,omitempty"`
	Action      string   `json:"action,omitempty"`
	ChallengeTS string   `json:"challenge_ts,omitempty"`
	HostName    string   `json:"hostname,omitempty"`
	ErrorCodes  []string `json:"error-codes,omitempty"`
}

Jump to

Keyboard shortcuts

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