Versions in this module Expand all Collapse all v0 v0.0.2 Jun 2, 2026 v0.0.1 Jun 2, 2026 Changes in this version + var ErrEmpty = errors.New("mailpatch: empty input") + var ErrMalformed = errors.New("mailpatch: malformed message") + type ChangeType int + const Added + const Copied + const Deleted + const Modified + const Renamed + func (c ChangeType) String() string + type DiffStat struct + Additions int + Deletions int + FilesChanged int + type FileChange struct + Additions int + Deletions int + Hunks []Hunk + IsBinary bool + NewMode string + NewPath string + OldMode string + OldPath string + Type ChangeType + func ParseDiff(diff string) ([]FileChange, error) + func (f FileChange) Path() string + type Hunk struct + Lines []Line + NewLines int + NewStart int + OldLines int + OldStart int + Section string + type Line struct + Kind LineKind + Text string + type LineKind int + const Add + const Context + const Delete + type Patch struct + AuthorEmail string + AuthorName string + Body string + Date time.Time + Diff string + Files []FileChange + From string + Header mail.Header + InReplyTo string + MessageID string + RawSubject string + References []string + Series SeriesInfo + Stat DiffStat + Subject string + func Parse(r io.Reader) (*Patch, error) + func ParseBytes(b []byte) (*Patch, error) + func ParseMbox(r io.Reader) ([]*Patch, error) + func (p *Patch) HasDiff() bool + func (p *Patch) IsCoverLetter() bool + type Series struct + Cover *Patch + Patches []*Patch + Total int + Version int + func ParseSeries(r io.Reader) (*Series, error) + func (s *Series) Complete() bool + func (s *Series) Len() int + type SeriesInfo struct + Index int + IsCover bool + Prefix string + Total int + Version int