Categorygithub.com/emersion/go-message
modulepackage
0.18.2
Repository: https://github.com/emersion/go-message.git
Documentation: pkg.go.dev

# README

go-message

Go Reference

A Go library for the Internet Message Format. It implements:

Features

  • Streaming API
  • Automatic encoding and charset handling (to decode all charsets, add import _ "github.com/emersion/go-message/charset" to your application)
  • A mail subpackage to read and write mail messages
  • DKIM-friendly
  • A textproto subpackage that just implements the wire format

License

MIT

# Packages

Package charset provides functions to decode and encode charsets.
Package mail implements reading and writing mail messages.
Package textproto implements low-level manipulation of MIME messages.

# Functions

CreateWriter creates a new message writer to w.
HeaderFromMap creates a header from a map of header fields.
IsUnknownCharset returns a boolean indicating whether the error is known to report that the charset advertised by the entity is unknown.
IsUnknownEncoding returns a boolean indicating whether the error is known to report that the encoding advertised by the entity is unknown.
New makes a new message with the provided header and body.
NewMultipart makes a new multipart message with the provided header and parts.
Read reads a message from r.
ReadWithOptions see Read, but allows overriding some parameters with ReadOptions.

# Variables

CharsetReader, if non-nil, defines a function to generate charset-conversion readers, converting from the provided charset into UTF-8.

# Structs

An Entity is either a whole message or a one of the parts in the body of a multipart entity.
A Header represents the key-value pairs in a message header.
ReadOptions are options for ReadWithOptions.
Writer writes message entities.

# Interfaces

HeaderFields iterates over header fields.
MultipartReader is an iterator over parts in a MIME multipart body.

# Type aliases

WalkFunc is the type of the function called for each part visited by Walk.