Documentation
¶
Index ¶
- func ParseRange(spec string) (int64, int64, error)
- type MailBuilder
- func (p MailBuilder) AddAttachment(b []byte, contentType string, fileName string) MailBuilder
- func (p MailBuilder) AddFileAttachment(path string) MailBuilder
- func (p MailBuilder) AddFileInline(path string) MailBuilder
- func (p MailBuilder) AddInline(b []byte, contentType string, fileName string, contentID string) MailBuilder
- func (p MailBuilder) Build() (*enmime.Part, error)
- func (p MailBuilder) Equals(o MailBuilder) bool
- func (p MailBuilder) Error() error
- func (p MailBuilder) HTML(body []byte) MailBuilder
- func (p MailBuilder) Header(name, value string) MailBuilder
- func (p MailBuilder) Text(body []byte) MailBuilder
- type Wildmat
- type WildmatPattern
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MailBuilder ¶
type MailBuilder struct {
// contains filtered or unexported fields
}
MailBuilder facilitates the easy construction of a MIME message. Each manipulation method returns a copy of the receiver struct. It can be considered immutable if the caller does not modify the string and byte slices passed in. Immutability allows the headers or entire message to be reused across multiple threads.
func (MailBuilder) AddAttachment ¶
func (p MailBuilder) AddAttachment(b []byte, contentType string, fileName string) MailBuilder
AddAttachment returns a copy of MailBuilder that includes the specified attachment.
func (MailBuilder) AddFileAttachment ¶
func (p MailBuilder) AddFileAttachment(path string) MailBuilder
AddFileAttachment returns a copy of MailBuilder that includes the specified attachment. fileName, will be populated from the base name of path. Content type will be detected from the path extension.
func (MailBuilder) AddFileInline ¶
func (p MailBuilder) AddFileInline(path string) MailBuilder
AddFileInline returns a copy of MailBuilder that includes the specified inline. fileName and contentID will be populated from the base name of path. Content type will be detected from the path extension.
func (MailBuilder) AddInline ¶
func (p MailBuilder) AddInline( b []byte, contentType string, fileName string, contentID string, ) MailBuilder
AddInline returns a copy of MailBuilder that includes the specified inline. fileName and contentID may be left empty.
func (MailBuilder) Build ¶
func (p MailBuilder) Build() (*enmime.Part, error)
Build performs some basic validations, then constructs a tree of Part structs from the configured MailBuilder. It will set the Date header to now if it was not explicitly set.
func (MailBuilder) Equals ¶
func (p MailBuilder) Equals(o MailBuilder) bool
Equals uses the reflect package to test two MailBuilder structs for equality, primarily for unit tests.
func (MailBuilder) Error ¶
func (p MailBuilder) Error() error
Error returns the stored error from a file attachment/inline read or nil.
func (MailBuilder) HTML ¶
func (p MailBuilder) HTML(body []byte) MailBuilder
HTML returns a copy of MailBuilder that will use the provided bytes for its text/html Part.
func (MailBuilder) Header ¶
func (p MailBuilder) Header(name, value string) MailBuilder
Header returns a copy of MailBuilder with the specified value added to the named header.
func (MailBuilder) Text ¶
func (p MailBuilder) Text(body []byte) MailBuilder
Text returns a copy of MailBuilder that will use the provided bytes for its text/plain Part.
type Wildmat ¶
type Wildmat struct {
// contains filtered or unexported fields
}
func ParseWildmat ¶
type WildmatPattern ¶
type WildmatPattern struct {
// contains filtered or unexported fields
}