Help us shape the future of Go! Take the 2026 Go Developer Survey

attach

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package attach is the content policy for downloaded attachments: the served type, the format word, the image normaliser and the MP4 scrub.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupported = errors.New("attach: media unsupported")
	ErrSpool       = errors.New("attach: spool access failed")
)

Functions

This section is empty.

Types

type Outcome

type Outcome struct {
	ServedType string
	Format     string
	Normalised bool
	Image      []byte
}

func Apply

func Apply(ctx context.Context, kind, variant string, s Spool) (Outcome, error)

type Spool

type Spool interface {
	Size() int64
	ReadAt(p []byte, off int64) (int, error)
	WriteAt(p []byte, off int64) (int, error)
	Truncate(size int64) error
}

Jump to

Keyboard shortcuts

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