email

package
v0.0.0-...-0d592ce Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 15 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAddrContext

func AddAddrContext(email, context string) (string, error)

AddAddrContext embeds context into local part of the provided email address using '+'. Returns the resulting email address.

func CanonicalEmail

func CanonicalEmail(email string) string

func FormReply

func FormReply(email *Email, reply string) string

func MergeEmailLists

func MergeEmailLists(lists ...[]string) []string

MergeEmailLists merges several email lists removing duplicates and invalid entries.

func ParsePatch

func ParsePatch(message []byte) (diff string)

func RemoveAddrContext

func RemoveAddrContext(email string) (string, string, error)

RemoveAddrContext extracts context after '+' from the local part of the provided email address. Returns address without the context and the context.

func RemoveFromEmailList

func RemoveFromEmailList(list []string, toRemove string) []string

Types

type Command

type Command int
const (
	CmdUnknown Command = iota
	CmdUpstream
	CmdFix
	CmdUnFix
	CmdDup
	CmdUnDup
	CmdTest
	CmdInvalid
	CmdUnCC
	CmdSet
	CmdUnset
	CmdRegenerate
)

type Email

type Email struct {
	BugIDs      []string
	MessageID   string
	InReplyTo   string
	Date        time.Time
	Link        string
	Subject     string
	MailingList string
	Author      string
	OwnEmail    bool
	Cc          []string
	Body        string // text/plain part
	Patch       string // attached patch, if any
	Commands    []*SingleCommand
}

func Parse

func Parse(r io.Reader, ownEmails, goodLists, domains []string) (*Email, error)

type MessageAction

type MessageAction string
const (
	ActionIgnore    MessageAction = "ignore"
	ActionAppend    MessageAction = "append"
	ActionNewThread MessageAction = "new-thread"
)

func NewMessageAction

func NewMessageAction(msg *Email, msgType dashapi.DiscussionType, oldThread *OldThreadInfo) MessageAction

type OldThreadInfo

type OldThreadInfo struct {
	ThreadType dashapi.DiscussionType
}

type SingleCommand

type SingleCommand struct {
	Command Command
	Str     string // string representation
	Args    string // arguments for the command
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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