smtpattach

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

smtpattach/store.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(id string)

func PurgeLoop

func PurgeLoop(age time.Duration)

func PurgeOlderThan

func PurgeOlderThan(age time.Duration)

PurgeOlderThan deletes attachments stored before the given duration. Call periodically if you want automatic cleanup, e.g. go PurgeLoop(1 * time.Hour)

func WriteToTempFile

func WriteToTempFile(a *Attachment) (string, error)

WriteToTempFile writes an attachment to a real temp file and returns the path. Useful if you want to hand the file off to another process.

Types

type Attachment

type Attachment struct {
	ID          string
	Filename    string
	ContentType string
	Size        int
	Data        []byte
	StoredAt    time.Time
}

func Get

func Get(id string) (*Attachment, bool)

func Save

func Save(id, filename, contentType string, data []byte) *Attachment

Jump to

Keyboard shortcuts

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