Documentation ¶
Index ¶
- type HandlerFunc
- type Parser
- func (p *Parser) AttachEmptyTextPartIfNoneExists() bool
- func (p *Parser) AttachPublicKey(key, keyName string)
- func (p *Parser) NewVisitor(defaultRule VisitorRule) *Visitor
- func (p *Parser) NewWalker() *Walker
- func (p *Parser) NewWriter() *Writer
- func (p *Parser) Root() *Part
- func (p *Parser) Section(section []int) (part *Part, err error)
- type Part
- func (p *Part) AddChild(child *Part)
- func (p *Part) Child(n int) (part *Part, err error)
- func (p *Part) Children() Parts
- func (p *Part) ContentDisposition() (string, map[string]string, error)
- func (p *Part) ContentType() (string, map[string]string, error)
- func (p *Part) ConvertMetaCharset() error
- func (p *Part) ConvertToUTF8() error
- func (p *Part) HasContentID() bool
- func (p *Part) InsertChild(index int, child *Part)
- func (p *Part) IsAttachment() bool
- type Parts
- type Visit
- type Visitor
- type VisitorRule
- type Walker
- func (w *Walker) RegisterContentDispositionHandler(dispRegExp string, fn HandlerFunc) *Walker
- func (w *Walker) RegisterContentTypeHandler(typeRegExp string, fn HandlerFunc) *Walker
- func (w *Walker) RegisterDefaultHandler(fn HandlerFunc) *Walker
- func (w *Walker) Walk() error
- func (w *Walker) WalkSkipAttachment() error
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HandlerFunc ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) AttachEmptyTextPartIfNoneExists ¶ added in v3.1.0
func (*Parser) AttachPublicKey ¶
func (*Parser) NewVisitor ¶
func (p *Parser) NewVisitor(defaultRule VisitorRule) *Visitor
type Part ¶
type Part struct { Header message.Header Body []byte // contains filtered or unexported fields }
func (*Part) ContentDisposition ¶ added in v3.7.0
func (*Part) ConvertMetaCharset ¶
func (*Part) ConvertToUTF8 ¶
func (*Part) HasContentID ¶ added in v3.7.0
func (*Part) InsertChild ¶ added in v3.7.0
func (*Part) IsAttachment ¶ added in v3.7.1
type Visitor ¶
type Visitor struct {
// contains filtered or unexported fields
}
func (*Visitor) RegisterRule ¶
func (v *Visitor) RegisterRule(contentTypeRegex string, fn VisitorRule) *Visitor
RegisterRule defines what to do when visiting a part whose content type matches the given regular expression. If a part matches multiple rules, the one registered first will be used.
type VisitorRule ¶
type Walker ¶
type Walker struct {
// contains filtered or unexported fields
}
func (*Walker) RegisterContentDispositionHandler ¶
func (w *Walker) RegisterContentDispositionHandler(dispRegExp string, fn HandlerFunc) *Walker
RegisterContentDispositionHandler registers a handler that will be called when a part's content disposition matches the given regular expression. If a part matches multiple handlers, the one registered first will be chosen.
func (*Walker) RegisterContentTypeHandler ¶
func (w *Walker) RegisterContentTypeHandler(typeRegExp string, fn HandlerFunc) *Walker
RegisterContentTypeHandler registers a handler that will be called when a part's content type matches the given regular expression. If a part matches multiple handlers, the one registered first will be chosen.
func (*Walker) RegisterDefaultHandler ¶
func (w *Walker) RegisterDefaultHandler(fn HandlerFunc) *Walker
RegisterDefaultHandler registers a handler that will be called on every part that doesn't match a registered content type/disposition handler.