export

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package export handles file export operations such as creating zip archives of email attachments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatBytesLong

func FormatBytesLong(b int64) string

FormatBytesLong formats bytes with full precision for export results.

func FormatExportResult added in v0.4.0

func FormatExportResult(stats ExportStats) string

FormatExportResult formats ExportStats into a human-readable string for display.

func SanitizeFilename

func SanitizeFilename(s string) string

SanitizeFilename removes or replaces characters that are invalid in filenames.

Types

type ExportStats added in v0.4.0

type ExportStats struct {
	Count      int
	Size       int64
	Errors     []string
	ZipPath    string
	WriteError bool // true if a write error occurred and the zip was removed
}

ExportStats contains structured results of an attachment export operation.

func Attachments

func Attachments(zipFilename, attachmentsDir string, attachments []query.AttachmentInfo) ExportStats

Attachments exports the given attachments into a zip file. It reads attachment content from attachmentsDir using content-hash based paths.

Jump to

Keyboard shortcuts

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