mailbox

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParserVersion    = "phase2-parser-v1"
	SchemaVersion    = "message.v2"
	MaxEMLBytes      = 25 * 1024 * 1024
	MaxIndexedBytes  = 2 * 1024 * 1024
	UnknownShape     = "unknown"
	LowConfidence    = "low"
	MediumConfidence = "medium"
	HighConfidence   = "high"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment added in v0.2.0

type Attachment struct {
	FileName    string `json:"fileName"`
	ContentType string `json:"contentType"`
	SizeBytes   int64  `json:"sizeBytes"`
}

type CalendarEvent added in v0.2.0

type CalendarEvent struct {
	Summary  string `json:"summary"`
	Location string `json:"location"`
	Start    string `json:"start"`
	End      string `json:"end"`
}

type Confidence added in v0.2.0

type Confidence struct {
	Score   float64  `json:"score"`
	Label   string   `json:"label"`
	Reasons []string `json:"reasons"`
}

func NewConfidence added in v0.2.0

func NewConfidence(score float64, reasons ...string) Confidence

type ImportError added in v0.2.0

type ImportError struct {
	Kind    string `json:"kind"`
	What    string `json:"what"`
	Why     string `json:"why"`
	NowWhat string `json:"nowWhat"`
}

func (ImportError) Error added in v0.2.0

func (err ImportError) Error() string

type ImportResult

type ImportResult struct {
	Imported int `json:"imported"`
	Skipped  int `json:"skipped"`
	Total    int `json:"total"`
}

type ImportWarning added in v0.2.0

type ImportWarning struct {
	Severity string `json:"severity"`
	Field    string `json:"field"`
	Message  string `json:"message"`
	NextStep string `json:"nextStep"`
}

type Message

type Message struct {
	ID              string                `json:"id"`
	SourceID        string                `json:"sourceId"`
	Subject         string                `json:"subject"`
	From            string                `json:"from"`
	To              []string              `json:"to"`
	Date            time.Time             `json:"date"`
	Snippet         string                `json:"snippet"`
	Body            string                `json:"body"`
	PrimaryBody     string                `json:"primaryBody"`
	Shape           string                `json:"shape"`
	Tags            []string              `json:"tags"`
	Confidence      Confidence            `json:"confidence"`
	FieldConfidence map[string]Confidence `json:"fieldConfidence"`
	Warnings        []ImportWarning       `json:"warnings"`
	Attachments     []Attachment          `json:"attachments"`
	Calendar        *CalendarEvent        `json:"calendar,omitempty"`
	Provenance      Provenance            `json:"provenance"`
}

func DemoMessages

func DemoMessages(now time.Time) []Message

func ParseEML

func ParseEML(reader io.Reader) (Message, error)

type Provenance added in v0.2.0

type Provenance struct {
	SourceID      string `json:"sourceId"`
	SourceSHA256  string `json:"sourceSha256"`
	ParserVersion string `json:"parserVersion"`
	SchemaVersion string `json:"schemaVersion"`
	SizeBytes     int64  `json:"sizeBytes"`
}

Jump to

Keyboard shortcuts

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