providers

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIME = "MIME-version: 1.0;\nContent-Type: text/html; charset=\"UTF-8\";\n\n"
)

Variables

This section is empty.

Functions

func NewLoggerProvider

func NewLoggerProvider(config *config.AppConfig) *zap.SugaredLogger

func NewServerProvider

func NewServerProvider(lifecycle fx.Lifecycle, appConfig *config.AppConfig, log *zap.SugaredLogger) *gin.Engine

Types

type DatabaseProvider

type DatabaseProvider interface {
	Connect() *gorm.DB
	Migrate()
}

func NewDatabaseProvider

func NewDatabaseProvider(config *config.DatabaseConfig, log *zap.SugaredLogger) DatabaseProvider

type Mail

type Mail struct {
	From    string
	To      string
	Subject string
	Body    string
}

func (*Mail) BuildMessage

func (mail *Mail) BuildMessage() string

type MailProvider

type MailProvider interface {
	Send(mail mail.Mailable, to string) bool
}

func NewMailProvider

func NewMailProvider(config *config.MailConfig, log *zap.SugaredLogger, template TemplateProvider, smtpMail SMTPMailProvider) MailProvider

type SMTPMailProvider

type SMTPMailProvider interface {
	Send(smtpServer SmtpServer, mail Mail, password string) error
}

func NewSMTPMailProvider

func NewSMTPMailProvider(log *zap.SugaredLogger) SMTPMailProvider

type SmtpServer

type SmtpServer struct {
	Host string
	Port string
}

func (*SmtpServer) ServerName

func (s *SmtpServer) ServerName() string

type TemplateProvider

type TemplateProvider interface {
	Parse(templatePath string, context interface{}) (string, error)
}

func NewTemplateProvider

func NewTemplateProvider(log *zap.SugaredLogger) TemplateProvider

Jump to

Keyboard shortcuts

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