attachment.go

 1package message
 2
 3import "strings"
 4
 5type Attachment struct {
 6	FilePath string
 7	FileName string
 8	MimeType string
 9	Content  []byte
10}
11
12func (a Attachment) IsText() bool  { return strings.HasPrefix(a.MimeType, "text/") }
13func (a Attachment) IsImage() bool { return strings.HasPrefix(a.MimeType, "image/") }