contracts

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttachMethod

type AttachMethod string
const (
	AttachMethodInline AttachMethod = "inline"
	AttachMethodFile   AttachMethod = "file"
)

type Attachment

type Attachment struct {
	MimeType     string
	AttachMethod AttachMethod
	Filename     string
	Name         string
	Extension    string
	Content      []byte
}

func NewAttachmentFromFile

func NewAttachmentFromFile(filePath string) (a Attachment, err error)

func (Attachment) GetAttachMethod

func (a Attachment) GetAttachMethod() AttachMethod

func (Attachment) GetContent

func (a Attachment) GetContent() []byte

func (Attachment) GetFileName

func (a Attachment) GetFileName() string

func (Attachment) GetMimeType

func (a Attachment) GetMimeType() string

func (Attachment) GetName

func (a Attachment) GetName() string

func (Attachment) IsEmpty

func (a Attachment) IsEmpty() bool

type LoggerInterface

type LoggerInterface interface {
	Print(log string)
	Printf(format string, args ...interface{})
}

type Message

type Message struct {
	From    mailing.MailAddress
	ReplyTo mailing.MailAddress
	To      mailing.MailAddressList
	Cc      mailing.MailAddressList
	Bcc     mailing.MailAddressList

	MimeType mime.Type
	Subject  string
	Content  []byte

	Attachments MessageAttachmentList
}

func (*Message) AddAttachment

func (mm *Message) AddAttachment(file MessageAttachmentInterface) error

func (*Message) AddAttachments

func (mm *Message) AddAttachments(files ...MessageAttachmentInterface) error

func (Message) GetAttachments

func (mm Message) GetAttachments() MessageAttachmentListInterface

func (Message) GetBcc

func (Message) GetBody

func (mm Message) GetBody() []byte

func (Message) GetCc

func (Message) GetFrom

func (mm Message) GetFrom() mailing.MailAddressInterface

func (Message) GetMimeType

func (mm Message) GetMimeType() mime.Type

func (Message) GetReplyTo

func (mm Message) GetReplyTo() mailing.MailAddressInterface

func (Message) GetSubject

func (mm Message) GetSubject() string

func (Message) GetTo

func (*Message) SetBcc

func (mm *Message) SetBcc(addr mailing.MailAddressInterface) error

func (*Message) SetBccs

func (mm *Message) SetBccs(addrs mailing.MailAddressListInterface)

func (*Message) SetCc

func (mm *Message) SetCc(addr mailing.MailAddressInterface) error

func (*Message) SetCcs

func (mm *Message) SetCcs(addrs mailing.MailAddressListInterface)

func (*Message) SetFrom

func (mm *Message) SetFrom(addr mailing.MailAddressInterface) error

func (*Message) SetHTML

func (mm *Message) SetHTML(msg []byte) error

func (*Message) SetMimeType added in v0.0.2

func (mm *Message) SetMimeType(typ mime.Type)

func (*Message) SetPlainText

func (mm *Message) SetPlainText(msg []byte) error

func (*Message) SetReplyTo

func (mm *Message) SetReplyTo(addr mailing.MailAddressInterface) error

func (*Message) SetSubject

func (mm *Message) SetSubject(sbj string) error

func (*Message) SetTo

func (mm *Message) SetTo(addr mailing.MailAddressInterface) error

func (*Message) SetTos

func (mm *Message) SetTos(addrs mailing.MailAddressListInterface)

func (Message) String

func (mm Message) String() string

type MessageAttachmentInterface

type MessageAttachmentInterface interface {
	IsEmpty() bool
	GetFileName() string
	GetName() string
	GetMimeType() string
	GetContent() []byte
	GetAttachMethod() AttachMethod
}

type MessageAttachmentList

type MessageAttachmentList []Attachment

func (MessageAttachmentList) GetFileNames

func (mal MessageAttachmentList) GetFileNames() []string

func (MessageAttachmentList) GetList

func (MessageAttachmentList) IsEmpty

func (mal MessageAttachmentList) IsEmpty() bool

type MessageAttachmentListInterface

type MessageAttachmentListInterface interface {
	GetList() []MessageAttachmentInterface
	IsEmpty() bool
	GetFileNames() []string
}

type MessageInterface

type MessageInterface interface {
	SetFrom(addr mailing.MailAddressInterface) error
	SetTo(addr mailing.MailAddressInterface) error
	SetTos(addrs mailing.MailAddressListInterface)
	SetCc(addr mailing.MailAddressInterface) error
	SetCcs(addrs mailing.MailAddressListInterface)
	SetBcc(addr mailing.MailAddressInterface) error
	SetBccs(addrs mailing.MailAddressListInterface)
	SetReplyTo(addr mailing.MailAddressInterface) error
	SetSubject(sbj string) error
	SetMimeType(typ mime.Type)
	SetHTML(msg []byte) error
	SetPlainText(msg []byte) error
	AddAttachment(file MessageAttachmentInterface) error
	AddAttachments(files ...MessageAttachmentInterface) error

	GetFrom() mailing.MailAddressInterface
	GetTo() mailing.MailAddressListInterface
	GetCc() mailing.MailAddressListInterface
	GetBcc() mailing.MailAddressListInterface
	GetReplyTo() mailing.MailAddressInterface
	GetSubject() string
	GetMimeType() mime.Type
	GetBody() []byte
	GetAttachments() MessageAttachmentListInterface

	String() string
}

type ProviderInterface

type ProviderInterface interface {
	Name() mailing.MailProviderName
	Send(ctx context.Context, msg MessageInterface) error
}

Jump to

Keyboard shortcuts

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