boltNotification

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2017 License: BSD-3-Clause Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDB

func NewDB(filename string, fileMode os.FileMode, boltOptions *bolt.Options) (db *bolt.DB, err error)

NewDB opens a new BoltDB database.

Types

type Logger added in v0.4.1

type Logger interface {
	Info(a ...interface{})
	Infof(format string, a ...interface{})
	Errorf(format string, a ...interface{})
}

Logger defines interface for logging messages with various severity levels.

type Service

type Service struct {
	DB *bolt.DB

	SMTPHost       string
	SMTPPort       int
	SMTPUsername   string
	SMTPPassword   string
	SMTPIdentity   string
	SMTPSkipVerify bool
	CleanupPeriod  time.Duration
	Logger         Logger
	// contains filtered or unexported fields
}

Service implements gopherpit.com/gopherpit/services/notification.Service interface.

func (Service) DataDump added in v0.2.1

func (s Service) DataDump(ifModifiedSince *time.Time) (dump *dataDump.Dump, err error)

DataDump implements dataDump.Interface interface to extract database data in a safe and reliable way.

func (Service) IsEmailOptedOut

func (s Service) IsEmailOptedOut(email string) (yes bool, err error)

IsEmailOptedOut returns true or false if e-mail address is marked not to send any e-mail messages to.

func (Service) OptOutEmail

func (s Service) OptOutEmail(email string) error

OptOutEmail marks an e-mail address not to send any e-mail messages to.

func (Service) PeriodicCleanup

func (s Service) PeriodicCleanup() (err error)

PeriodicCleanup deletes expired email message IDs on a period defined in Service.CleanupPeriod.

func (Service) RemoveOptedOutEmail

func (s Service) RemoveOptedOutEmail(email string) error

RemoveOptedOutEmail removes an opt-out mark previosulu set by OptOutEmail.

func (Service) SendEmail

func (s Service) SendEmail(email notification.Email) (id string, err error)

SendEmail sends an e-mail message and returns it's ID.

Jump to

Keyboard shortcuts

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