util

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRSABit = 8192

Variables

This section is empty.

Functions

func GenerateKeys added in v1.4.0

func GenerateKeys(privpath, pubpath string) error

func InitMail

func InitMail(sendgridAPIKey, fromAddr, fromName string)

InitMail setup mail configuration

func LoadConfigEnv

func LoadConfigEnv()

LoadConfigEnv reads config from environment variable

func LoadConfigFile

func LoadConfigFile(path string) error

LoadConfigFile reads config from file

func SendMail

func SendMail(ToAddr, ToName, subject, text, textHTML string) error

SendMail sends email. The mail is sent as plain text if textHTML is empty.

func SendMailWithTemplate

func SendMailWithTemplate(ToAddr, ToName, subject, tmplfile string, dat map[string]string) error

SendMailWithTemplate sends email using template file. The mail is sent as plain text if textHTML is empty.

Types

type APIConf

type APIConf struct {
	Host                   string
	Port                   string
	CORS                   string
	PermitUserToCreateTeam bool
}

APIConf is structure for API configuration

func GetAPIConf

func GetAPIConf() APIConf

GetAPIConf returns API config

type DBConf

type DBConf struct {
	Host string
	Port string
	User string
	Pass string
	Name string
}

DBConf is structure for database configuration

func GetDBConf

func GetDBConf() DBConf

GetDBConf returns database config

type FileConf

type FileConf struct {
	FrontDir   string
	DataDir    string
	SignPubKey string
	SignPrvKey string
	LogFile    string
}

FileConf is structure for file configuration

func GetFileConf

func GetFileConf() FileConf

GetFileConf returns file config

type MailConf

type MailConf struct {
	SendGridAPIKey string
	FromAddr       string
	FromName       string
	TmplResetPW    string
	TmplRegist     string
}

MailConf is structure for mail configuration

func GetMailConf

func GetMailConf() MailConf

GetMailConf returns mail config

Jump to

Keyboard shortcuts

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