util

package
v0.0.0-...-9abda77 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ResourceFolder = "./res/"

Variables

This section is empty.

Functions

func CreateResourceFolderIfNotExists

func CreateResourceFolderIfNotExists() error

func GetJsonFromReader

func GetJsonFromReader(reader io.ReadCloser) (map[string]interface{}, error)

func GetRandomString

func GetRandomString(length int) string

func IfFileExists

func IfFileExists(fileName string) (bool, error)

func ReadJsonObjectAsMap

func ReadJsonObjectAsMap(obj *fastjson.Object) map[string]interface{}

func ToBsonD

func ToBsonD(d interface{}) (doc *bson.D, err error)

ToBsonD transforms a given Interface to bson.D though binary marschalling

Types

type MailTemplateDefaults

type MailTemplateDefaults struct {
	Subject       string
	Recipient     string
	From          string
	RecipientName string
	FromName      string
	Text          string
	LinkText      string
	ClickLink     string
}

type SmtpClient

type SmtpClient struct {
	Server string
	// contains filtered or unexported fields
}

func NewMailClient

func NewMailClient(smtpServer string, port int, user string, password string) (*SmtpClient, error)

func (*SmtpClient) SendText

func (m *SmtpClient) SendText(from string, to []string, t *template.Template, template_data interface{}) error

func (*SmtpClient) SendWithTextTemplate

func (m *SmtpClient) SendWithTextTemplate(from string, to []string, name string, template_data interface{}) error

Jump to

Keyboard shortcuts

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