helper

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertWeightUnit

func ConvertWeightUnit(unit string) string

func FindItemIDByItemName added in v0.4.0

func FindItemIDByItemName(inventories dataset.Inventories, itemname string) uint

func FindPackIDByPackName added in v0.4.0

func FindPackIDByPackName(packs dataset.Packs, packname string) uint

func FindUserIDByUsername added in v0.4.0

func FindUserIDByUsername(users []dataset.User, username string) uint

func GenerateRandomCode added in v0.3.0

func GenerateRandomCode(length int) (string, error)

func IsValidEmail added in v0.4.1

func IsValidEmail(email string) bool

func StringToUint

func StringToUint(s string) (uint, error)

Types

type EmailSender added in v0.3.0

type EmailSender interface {
	SendEmail(to, subject, body string) error
}

EmailSender defines the interface for sending emails. Needed for testing without real SMTP server.

type SMTPClient added in v0.3.0

type SMTPClient struct {
	Server dataset.MailServer
}

SMTPClient struct implements EmailSender interface.

func (*SMTPClient) SendEmail added in v0.3.0

func (s *SMTPClient) SendEmail(to, subject, body string) error

SendMail sends an email using the SMTP protocol.

Jump to

Keyboard shortcuts

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