Documentation
¶
Index ¶
- Constants
- func Apply(snapshot *DraftSnapshot, patch Patch) error
- func CreateWithRaw(runtime *common.RuntimeContext, mailboxID, rawEML string) (string, error)
- func MustJSON(v interface{}) string
- func Send(runtime *common.RuntimeContext, mailboxID, draftID string) (map[string]interface{}, error)
- func Serialize(snapshot *DraftSnapshot) (string, error)
- func UpdateWithRaw(runtime *common.RuntimeContext, mailboxID, draftID, rawEML string) error
- type Address
- type AttachmentTarget
- type DraftProjection
- type DraftRaw
- type DraftSnapshot
- type Header
- type Part
- type PartSummary
- type Patch
- type PatchOp
- type PatchOptions
Constants ¶
View Source
const QuoteWrapperClass = "history-quote-wrapper"
QuoteWrapperClass is the CSS class name used by Lark's mail composer for reply/forward quote blocks. Both +reply and +forward wrap the quoted original message in a <div> with this class. Exported so that mail_quote.go (the generator) and projection.go (the detector) share a single source of truth.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
func Apply(snapshot *DraftSnapshot, patch Patch) error
func CreateWithRaw ¶
func CreateWithRaw(runtime *common.RuntimeContext, mailboxID, rawEML string) (string, error)
func Send ¶
func Send(runtime *common.RuntimeContext, mailboxID, draftID string) (map[string]interface{}, error)
func Serialize ¶
func Serialize(snapshot *DraftSnapshot) (string, error)
func UpdateWithRaw ¶
func UpdateWithRaw(runtime *common.RuntimeContext, mailboxID, draftID, rawEML string) error
Types ¶
type AttachmentTarget ¶
type DraftProjection ¶
type DraftProjection struct {
Subject string `json:"subject"`
To []Address `json:"to,omitempty"`
Cc []Address `json:"cc,omitempty"`
Bcc []Address `json:"bcc,omitempty"`
ReplyTo []Address `json:"reply_to,omitempty"`
InReplyTo string `json:"in_reply_to,omitempty"`
References string `json:"references,omitempty"`
BodyText string `json:"body_text,omitempty"`
BodyHTMLSummary string `json:"body_html_summary,omitempty"`
HasQuotedContent bool `json:"has_quoted_content,omitempty"`
AttachmentsSummary []PartSummary `json:"attachments_summary,omitempty"`
InlineSummary []PartSummary `json:"inline_summary,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
func Project ¶
func Project(snapshot *DraftSnapshot) DraftProjection
type DraftSnapshot ¶
type DraftSnapshot struct {
DraftID string
Headers []Header
Body *Part
Subject string
From []Address
To []Address
Cc []Address
Bcc []Address
ReplyTo []Address
MessageID string
InReplyTo string
References string
PrimaryTextPartID string
PrimaryHTMLPartID string
}
func Parse ¶
func Parse(raw DraftRaw) (*DraftSnapshot, error)
type Part ¶
type Part struct {
PartID string
Headers []Header
MediaType string
MediaParams map[string]string
ContentDisposition string
ContentDispositionArg map[string]string
ContentID string
TransferEncoding string
Children []*Part
Body []byte
Preamble []byte
Epilogue []byte
RawEntity []byte
Dirty bool
// EncodingProblem is set when the part's body could not be decoded as
// declared (e.g. malformed base64, bad charset, unparseable Content-Type).
// The part still contains usable data (raw bytes or fallback decode) and
// can round-trip through RawEntity, but callers should treat Body as
// potentially degraded.
EncodingProblem bool
}
func (*Part) IsMultipart ¶
type PartSummary ¶
type Patch ¶
type Patch struct {
Ops []PatchOp `json:"ops"`
Options PatchOptions `json:"options,omitempty"`
}
type PatchOp ¶
type PatchOp struct {
Op string `json:"op"`
Value string `json:"value,omitempty"`
Field string `json:"field,omitempty"`
Address string `json:"address,omitempty"`
Name string `json:"name,omitempty"`
Addresses []Address `json:"addresses,omitempty"`
BodyKind string `json:"body_kind,omitempty"`
Selector string `json:"selector,omitempty"`
Path string `json:"path,omitempty"`
CID string `json:"cid,omitempty"`
FileName string `json:"filename,omitempty"`
ContentType string `json:"content_type,omitempty"`
Target AttachmentTarget `json:"target,omitempty"`
}
type PatchOptions ¶
Click to show internal directories.
Click to hide internal directories.