rawmessage

package
v1.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2021 License: GPL-3.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Name    string
	Address string
}

func ParseAddress

func ParseAddress(address string) (*Address, error)

ParseAddress parses a single RFC 5322 address, e.g. "Barry Gibbs <bg@example.com>"

func ParseAddressList

func ParseAddressList(list string) ([]*Address, error)

ParseAddressList parses the given string as a list of addresses.

func (*Address) String

func (a *Address) String() string

String formats the address as a valid RFC 5322 address. If the address's name contains non-ASCII characters the name will be rendered according to RFC 2047.

type AddressParser

type AddressParser struct {
	// WordDecoder optionally specifies a decoder for RFC 2047 encoded-words.
	WordDecoder *mime.WordDecoder
}

An AddressParser is an RFC 5322 address parser.

func (*AddressParser) Parse

func (p *AddressParser) Parse(address string) (*Address, error)

Parse parses a single RFC 5322 address of the form "Gogh Fir <gf@example.com>" or "foo@example.com".

func (*AddressParser) ParseList

func (p *AddressParser) ParseList(list string) ([]*Address, error)

ParseList parses the given string as a list of comma-separated addresses of the form "Gogh Fir <gf@example.com>" or "foo@example.com".

type Header struct {
	textproto.Header
}

func (*Header) ContentDisposition

func (h *Header) ContentDisposition() (disp string, params map[string]string, err error)

func (*Header) ContentType

func (h *Header) ContentType() (t string, params map[string]string, err error)

func (*Header) Fields

func (h *Header) Fields() HeaderFields

func (*Header) FieldsByKey

func (h *Header) FieldsByKey(k string) HeaderFields

func (*Header) SetContentDisposition

func (h *Header) SetContentDisposition(disp string, params map[string]string)

func (*Header) SetContentType

func (h *Header) SetContentType(t string, params map[string]string)

func (*Header) SetText

func (h *Header) SetText(k, v string)

func (*Header) Text

func (h *Header) Text(k string) (string, error)

type HeaderFields

type HeaderFields interface {
	textproto.HeaderFields

	Text() (string, error)
}

type MultipartReader

type MultipartReader interface {
	io.Closer
	NextPart() (*RawEntity, error)
}

type RawEntity

type RawEntity struct {
	Header Header
	Body   io.Reader
	// contains filtered or unexported fields
}

---------------------------------------------- Entity

func RawNew

func RawNew(header Header, body io.Reader) (*RawEntity, error)

func Read

func Read(r io.Reader) (*RawEntity, error)

func (*RawEntity) MultipartReader

func (e *RawEntity) MultipartReader() MultipartReader

func (*RawEntity) WriteTo

func (e *RawEntity) WriteTo(w io.Writer) error

WriteTo writes this entity's header and body to w.

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func CreateWriter

func CreateWriter(w io.Writer, header Header) (*Writer, error)

func (*Writer) Close

func (w *Writer) Close() error

func (*Writer) CreatePart

func (w *Writer) CreatePart(header Header) (*Writer, error)

func (*Writer) Write

func (w *Writer) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL