cbmail

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	GetRequiredString(path string) (string, error)
}

type Contact

type Contact struct {
	// contains filtered or unexported fields
}

func NewContact

func NewContact(name, email string) *Contact

func (*Contact) GetEmail

func (c *Contact) GetEmail() string

func (*Contact) GetName

func (c *Contact) GetName() string

type DefaultErrorHandler

type DefaultErrorHandler struct{}

func (DefaultErrorHandler) Error

func (d DefaultErrorHandler) Error(e error)

func (DefaultErrorHandler) Recover

func (d DefaultErrorHandler) Recover()

type DefaultLogger

type DefaultLogger struct{}

func (DefaultLogger) InfoF

func (d DefaultLogger) InfoF(category string, message string, args ...interface{})

type Dependencies

type Dependencies struct {
	Config       Config
	Logger       Logger
	ErrorHandler ErrorHandler
}

type Email

type Email interface {
	SetFrom(contact *Contact)
	AddTo(contact *Contact)
	AddCC(contact *Contact)
	AddBCC(contact *Contact)
	SetReplyTo(contact *Contact)
	SetSubject(subject string)
	SetHeader(key, value string)
	SetTextBody(body string)
	SetHtmlBody(body string)
	AddAttachment(filename, contentType string, content []byte)
	Send() error
}

type ErrorHandler

type ErrorHandler interface {
	Error(e error)
	Recover()
}

type Logger

type Logger interface {
	InfoF(category string, message string, args ...interface{})
}

type Provider

type Provider interface {
	New() Email
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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