mailservice

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DownstreamError = errors.New("downstream unavailable - see log for details")
)

Functions

func Create

func Create() (err error)

Types

type Impl

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

func (Impl) SendEmail

func (i Impl) SendEmail(ctx context.Context, request MailSendDto) error

type MailSendDto

type MailSendDto struct {
	CommonID  string            `json:"cid"`
	Lang      string            `json:"lang"`
	To        []string          `json:"to"`
	Cc        []string          `json:"cc"`
	Bcc       []string          `json:"bcc"`
	Variables map[string]string `json:"variables"`
}

type MailService

type MailService interface {
	SendEmail(ctx context.Context, request MailSendDto) error
}

func Get

func Get() MailService

type Mock

type Mock interface {
	MailService

	Reset()
	Recording() []MailSendDto
	SimulateError(err error)
}

func CreateMock

func CreateMock() Mock

type MockImpl

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

func (*MockImpl) Recording

func (m *MockImpl) Recording() []MailSendDto

func (*MockImpl) Reset

func (m *MockImpl) Reset()

func (*MockImpl) SendEmail

func (m *MockImpl) SendEmail(ctx context.Context, request MailSendDto) error

func (*MockImpl) SimulateError

func (m *MockImpl) SimulateError(err error)

Jump to

Keyboard shortcuts

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