tools

package
v0.0.0-...-c282490 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2025 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MailTemplate = `` /* 2684-byte string literal not displayed */

Functions

func DecryptAES

func DecryptAES(encryptedStr string, key []byte) ([]byte, error)

DecryptAES decrypts base64 encoded string using AES-GCM

func EncryptAES

func EncryptAES(plaintext []byte, key []byte) (string, error)

EncryptAES encrypts data using AES-GCM and returns base64 encoded string

func GenerateInvoice

func GenerateInvoice(bountyID, claimID uint) error

func GetNextInvoiceNumber

func GetNextInvoiceNumber(year int, month time.Month) string

func RandomString

func RandomString(n uint) (string, error)

Generates a random verification for an ad

func SendDiscordMessage

func SendDiscordMessage(channel string, message string) error

func SendEmail

func SendEmail(to, subject, content string) error

func SendInvoiceEmail

func SendInvoiceEmail(data EmailInvoiceData, pdfPath string) error

Types

type EmailInvoiceData

type EmailInvoiceData struct {
	To            string
	InvoiceNumber string
	Amount        float64
	CustomerName  string
}

type InvoiceData

type InvoiceData struct {
	InvoiceNumber   string
	CustomerName    string
	CustomerAddress string
	CustomerNIF     string
	Amount          float64
	VAT             float64
}

Jump to

Keyboard shortcuts

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