Documentation ¶
Overview ¶
Package gmime implements the MIME, port of C GMime
Index ¶
- func AssignJanitor(self Janitor)
- func CastContentDisposition(c *C.GMimeContentDisposition) *aContentDisposition
- func CastDataWrapper(dw *C.GMimeDataWrapper) *aDataWrapper
- func CastMemStream(cms *C.GMimeStreamMem) *aMemStream
- func CastMessage(m *C.GMimeMessage) *aMessage
- func CastObject(o *C.GMimeObject) *anObject
- func CastPart(p *C.GMimePart) *aPart
- func CastStream(cs *C.GMimeStream) *aStream
- func NewContentDispositionFromString(str string) *aContentDisposition
- func Shutdown()
- type Address
- type AddressList
- type ContentDisposition
- type ContentEncodingState
- type ContentType
- type DataWrapper
- type GMimeParamsCallback
- type Group
- type GroupAddress
- type HeaderIterator
- type InternetAddressList
- func (l *InternetAddressList) Add(address Address) int
- func (l *InternetAddressList) Append(newList AddressList)
- func (l *InternetAddressList) Clear()
- func (l *InternetAddressList) Contains(address Address) bool
- func (l *InternetAddressList) GetAddress(index int) Address
- func (l *InternetAddressList) GetLength() int
- func (l *InternetAddressList) IndexOf(address Address) int
- func (l *InternetAddressList) Insert(address Address, index int)
- func (l *InternetAddressList) Prepend(newList AddressList)
- func (l *InternetAddressList) Remove(address Address) bool
- func (l *InternetAddressList) RemoveAt(index int) bool
- func (l *InternetAddressList) SetAddress(address Address, index int)
- func (l *InternetAddressList) Slice() []Address
- func (l *InternetAddressList) ToString(encode bool) string
- func (l *InternetAddressList) Walk(callback func(Address))
- type Janitor
- type Mailbox
- type MailboxAddress
- type MemStream
- type Message
- type MessagePart
- type MessagePartial
- type Multipart
- type Object
- type Parametrized
- type Parse
- type Parser
- type Part
- type PartIter
- type PointerMixin
- type Stream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssignJanitor ¶
func AssignJanitor(self Janitor)
func CastContentDisposition ¶
func CastContentDisposition(c *C.GMimeContentDisposition) *aContentDisposition
func CastDataWrapper ¶
func CastDataWrapper(dw *C.GMimeDataWrapper) *aDataWrapper
func CastMemStream ¶
func CastMemStream(cms *C.GMimeStreamMem) *aMemStream
func CastMessage ¶
func CastMessage(m *C.GMimeMessage) *aMessage
func CastObject ¶
func CastObject(o *C.GMimeObject) *anObject
func CastStream ¶
func CastStream(cs *C.GMimeStream) *aStream
func NewContentDispositionFromString ¶
func NewContentDispositionFromString(str string) *aContentDisposition
Types ¶
type Address ¶
XXX The underlying type-unsafe C implementation is modeled here with a type-safe Object-Oriented design, which is a modified form of the Composite Design Pattern. Specifically, Address is the Component, Mailbox is the Leaf, and Group & AddressList co-operate to act as the Composite. SEE TestCompositeAddress.
func CastAddress ¶
func CastAddress(ca *C.InternetAddress) Address
type AddressList ¶
type AddressList interface { Janitor GetLength() int Clear() Add(Address) int Prepend(AddressList) Append(AddressList) Insert(Address, int) Remove(Address) bool RemoveAt(int) bool Contains(Address) bool IndexOf(Address) int GetAddress(int) Address SetAddress(Address, int) ToString(bool) string Walk(callback func(Address)) Slice() []Address }
func ParseString ¶
func ParseString(str string) AddressList
type ContentDisposition ¶
type ContentEncodingState ¶
type ContentEncodingState interface { Outlen(inlen int) (outlen int) Step(in []byte) (out []byte) Flush(in []byte) (out []byte) }
func NewContentDecoder ¶
func NewContentDecoder(encoding string) ContentEncodingState
func NewContentEncoder ¶
func NewContentEncoder(encoding string) ContentEncodingState
type ContentType ¶
type ContentType interface { Janitor Parametrized ToString() string MediaType() string MediaSubtype() string }
func CastContentType ¶
func CastContentType(ct *C.GMimeContentType) ContentType
func NewContentType ¶
func NewContentType(ctype string, csubtype string) ContentType
func NewContentTypeFromString ¶
func NewContentTypeFromString(str string) ContentType
type DataWrapper ¶
type DataWrapper interface { Janitor Encoding() string WriteToStream(stream Stream) uintptr Stream() Stream }
func NewDataWrapper ¶
func NewDataWrapper() DataWrapper
func NewDataWrapperWithStream ¶
func NewDataWrapperWithStream(stream Stream, encoding string) DataWrapper
type GMimeParamsCallback ¶
type Group ¶
type Group interface { Address Members() AddressList SetMembers(AddressList) AddMember(Address) int }
type GroupAddress ¶
type GroupAddress struct {
// contains filtered or unexported fields
}
func CastGroupAddress ¶
func CastGroupAddress(ga *C.InternetAddressGroup) *GroupAddress
func NewGroupAddress ¶
func NewGroupAddress(name string) *GroupAddress
func (*GroupAddress) AddMember ¶
func (group *GroupAddress) AddMember(newAddress Address) int
func (*GroupAddress) Members ¶
func (group *GroupAddress) Members() AddressList
func (*GroupAddress) SetMembers ¶
func (group *GroupAddress) SetMembers(list AddressList)
type HeaderIterator ¶
Very minimal interface, to inspection only
type InternetAddressList ¶
type InternetAddressList struct {
*PointerMixin
}
func CastInternetAddressList ¶
func CastInternetAddressList(cList *C.InternetAddressList) *InternetAddressList
func NewAddressList ¶
func NewAddressList() *InternetAddressList
func (*InternetAddressList) Add ¶
func (l *InternetAddressList) Add(address Address) int
func (*InternetAddressList) Append ¶
func (l *InternetAddressList) Append(newList AddressList)
func (*InternetAddressList) Clear ¶
func (l *InternetAddressList) Clear()
func (*InternetAddressList) Contains ¶
func (l *InternetAddressList) Contains(address Address) bool
func (*InternetAddressList) GetAddress ¶
func (l *InternetAddressList) GetAddress(index int) Address
func (*InternetAddressList) GetLength ¶
func (l *InternetAddressList) GetLength() int
func (*InternetAddressList) IndexOf ¶
func (l *InternetAddressList) IndexOf(address Address) int
func (*InternetAddressList) Insert ¶
func (l *InternetAddressList) Insert(address Address, index int)
func (*InternetAddressList) Prepend ¶
func (l *InternetAddressList) Prepend(newList AddressList)
func (*InternetAddressList) Remove ¶
func (l *InternetAddressList) Remove(address Address) bool
func (*InternetAddressList) RemoveAt ¶
func (l *InternetAddressList) RemoveAt(index int) bool
func (*InternetAddressList) SetAddress ¶
func (l *InternetAddressList) SetAddress(address Address, index int)
func (*InternetAddressList) Slice ¶
func (l *InternetAddressList) Slice() []Address
func (*InternetAddressList) ToString ¶
func (l *InternetAddressList) ToString(encode bool) string
func (*InternetAddressList) Walk ¶
func (l *InternetAddressList) Walk(callback func(Address))
type Janitor ¶
type Janitor interface {
// contains filtered or unexported methods
}
Janitor to clean up wasteful resources
type MailboxAddress ¶
type MailboxAddress struct {
// contains filtered or unexported fields
}
func CastMailboxAddress ¶
func CastMailboxAddress(ma *C.InternetAddressMailbox) *MailboxAddress
func NewMailboxAddress ¶
func NewMailboxAddress(name string, email string) *MailboxAddress
func (*MailboxAddress) Email ¶
func (a *MailboxAddress) Email() string
func (*MailboxAddress) SetEmail ¶
func (a *MailboxAddress) SetEmail(email string)
type Message ¶
type Message interface { Object SetSubject(string) Sender() *InternetAddressList Subject() (string, bool) SetMessageId(string) MessageId() (string, bool) To() *InternetAddressList Cc() *InternetAddressList Bcc() *InternetAddressList AllRecipients() *InternetAddressList SetMimePart(Object) MimePart() Object Body() Object }
func NewMessage ¶
func NewMessage() Message
type MessagePart ¶
func CastMessagePart ¶
func CastMessagePart(mp *C.GMimeMessagePart) MessagePart
func NewMessagePart ¶
func NewMessagePart(subtype string) MessagePart
func NewMessagePartWithMessage ¶
func NewMessagePartWithMessage(subtype string, message Message) MessagePart
type MessagePartial ¶
func CastMessagePartial ¶
func CastMessagePartial(mp *C.GMimeMessagePartial) MessagePartial
func NewMessagePartial ¶
func NewMessagePartial(id string, number int, total int) MessagePartial
type Multipart ¶
type Multipart interface { Object AddPart(Object) Boundary() string GetPart(int) Object Count() int Clear() Walk(func(Object) error) error }
func CastMultipart ¶
func CastMultipart(mp *C.GMimeMultipart) Multipart
func NewMultipart ¶
func NewMultipart() Multipart
func NewMultipartWithSubtype ¶
type Object ¶
type Object interface { Janitor ContentType() ContentType ContentID() (string, bool) Header(string) (string, bool) ToString() string ContentDisposition() ContentDisposition Headers() string WalkHeaders(cb func(string, string) error) error }
func NewObject ¶
func NewObject(contentType ContentType) Object
func NewObjectWithType ¶
type Parametrized ¶
type Parametrized interface { SetParameter(name, value string) Parameter(name string) string ForEachParam(callback GMimeParamsCallback) }
type Parse ¶
type Parse interface { To() string Subject() (string, bool) From() string Bcc() string Cc() string Recipients() string MessageId() (string, bool) Text() (string, bool) Html() (string, bool) Attachment() map[string][]byte // AttachmentReader() Reader Headers() string Header(string) (string, bool) Boundary() string }
type Parser ¶
type Parser interface { Janitor ConstructMessage() Message ConstructPart() Object Tell() int64 Eos() bool SetScanFrom(bool) }
func CastParser ¶
func CastParser(p *C.GMimeParser) Parser
func NewParserWithStream ¶
type Part ¶
type Part interface { Object ContentObject() DataWrapper SetContentObject(DataWrapper) Filename() string Description() string ContentLocation() string ContentEncoding() string }
func NewPartWithType ¶
type PartIter ¶
func NewPartIter ¶
type PointerMixin ¶
type PointerMixin struct {
// contains filtered or unexported fields
}
func CastPointer ¶
func CastPointer(p C.gpointer) *PointerMixin
type Stream ¶
type Stream interface { Janitor Read(int64) (int64, []byte) Write([]byte) int64 WriteBlock([]byte, int64) int64 Flush() int Close() int Eos() bool Reset() int Seek(int64, int) (int64, error) Tell() int64 Length() int64 SubStream(int64, int64) Stream SetBounds(int64, int64) WriteString(string) int64 WriteToStream(Stream) int64 }
Click to show internal directories.
Click to hide internal directories.