modulepackage
0.0.0-20230322103455-7d82a3887f2f
Repository: https://github.com/protonmail/go-mime.git
Documentation: pkg.go.dev
# README
Go Mime Wrapper Library
Provides a parser for MIME messages
Download/Install
Run go get -u github.com/ProtonMail/go-mime
, or manually git clone
the
repository into $GOPATH/src/github.com/ProtonMail/go-mime
.
Usage
The library can be used to extract the body and attachments from a MIME message
Example:
printAccepter := gomime.NewMIMEPrinter()
bodyCollector := gomime.NewBodyCollector(printAccepter)
attachmentsCollector := gomime.NewAttachmentsCollector(bodyCollector)
mimeVisitor := gomime.NewMimeVisitor(attachmentsCollector)
err := gomime.VisitAll(bytes.NewReader(mmBodyData), h, mimeVisitor)
attachments := attachmentsCollector.GetAttachments(),
attachmentsHeaders := attachmentsCollector.GetAttHeaders()
bodyContent, bodyMimeType := bodyCollector.GetBody()
# Functions
DecodeCharset decodes the orginal using content type parameters.
DecodeContentEncoding wraps the reader with decoder based on content encoding.
DecodeHeader if needed.
EncodeHeader using quoted printable and utf8.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewMIMEVisitor initialiazed with acceptor.
No description provided by the author
NewUtf7Decoder return decoder for utf7.
No description provided by the author
# Variables
ErrBadUTF7 is returned to indicate the invalid modified UTF-7 encoding.
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
MIMEVisitor is main object to parse (visit) and process (accept) all parts of MIME message.
No description provided by the author
# Interfaces
VisitAcceptor decidest what to do with part which is processed It is used by MIMEVisitor.