# Packages
Package header provides low-level and high-level tooling for dealing with email message headers.
Package transfer contains utilities related to encoding and decoding transfer encodings, which interpret the Content-transfer-encoding header to apply certain 8bit to 7bit encodings.
No description provided by the author
Package walker provides utilities for iterating through the message and all its parts.
# Functions
AttachmentFile is a constructor that will create an Opaque from the given filename and MIME type.
DecodeTransferEncoding is a ParseOption that enables the decoding of Content-transfer-encoding.
GenerateBoundary will generate a random MIME boundary that is probably unique in most circumstances.
GenerateSafeBoundary will generate a random MIME boundary that is guaranteed to be safe with the given corpus of data.
MultipartAlternative returns a Multipart with a Content-type header set to multipart/alternative and the given parts attached.
MultipartMixed returns a Multipart with a Content-type header set to multipart/mixed and the given parts attached.
NewBlankBuffer starts a Buffer from the given Part by cloning the header.Header and preparing it to hold the same contents (i.e., setting the BufferMode based upon the result of IsMultipart()).
NewBuffer returns a buffer copied from the given message.Part.
Parse will consume input from the given reader and return a Generic message containing the parsed content.
WithChunkSize is a ParseOption that controls how many bytes to read at a time while parsing an email message.
WithMaxDepth is a ParseOption that controls how deep the parser will go in recursively parsing a multipart message.
WithMaxHeaderLength is a ParseOption that sets the maximum size the buffer is allowed to reach before parsing exits with an ErrLargeHeader error.
WithMaxPartLength is a ParseOption that sets the maximum size the buffer is allowed to reach while scanning for message parts at any level.
WithoutMultipart is a ParseOption that will not allow parsing of any multipart messages.
WithoutRecursion is a ParseOption that will only allow a single level of multipart parsing.
WithUnlimitedRecursion is a ParseOption that will allow the parser to parse sub-parts of any depth.
# Constants
DefaultChunkSize the default size of chunks to read from the input while splitting the message into header and body.
DefaultMaxHeaderLength is the default maximum byte length to scan before giving up on finding the end of the header.
DefaultMaxMultipartDepth is the default depth the parser will recurse into a message.
DefaultMaxPartLength is the default maximum byte length to scan before given up on scanning a message part at any given level.
DefaultMultipartContentType is the Content-type to use with a multipart message when no explicit Content-type header has been set.
ModeMultipart indicates that the Buffer has had the parts manipulated.
ModeOpaque indicates that the Buffer has been used as an io.Writer.
ModeUnset indicates that the Buffer has not yet been modified.
# Variables
ErrLargeHeader is returned by Parse when the header is longer than the configured WithMaxHeaderLength option (or the default, DefaultMaxHeaderLength).
ErrLargePart is returned by Parse when apart is longer than the configured WithMaxPartLength option (or the default, DefaultMaxPartLength).
ErrModeUnset is returned by Opaque() and Multipart() when they are called before anything has been written to the current buffer.
ErrOpaqueBuffer is returned by Add() if that method is called after calling the Write() method.
ErrParsesAsNotMultipart is returned by Multipart() when the Buffer is in ModeOpaque and the message is not at all a *Multipart message.
ErrPartsBuffer is returned by Write() if that method is called after calling the Add() method.
# Interfaces
Part is an interface define the parts of a Multipart.
# Type aliases
No description provided by the author
Generic is just an alias for Part, which is intended to convey additional semantics:
1.
ParseOption refers to options that may be passed to the Parse function to modify how the parser works.