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

image

package
v0.78.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package image is the media worker's image producer (libvips, CGO): the Image presets' private WebP files, the Zip presets, the public presets' owned generations, editor views, and the kinds' default public images. A Processor runs one media.ProcessJob: it redoes stale or pending outputs, records them in one manifest edit per pass, and keeps public/ in step.

Index

Constants

View Source
const Recipe = "webp-1"

Recipe versions the image producer: a change re-renders every image output.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Store     media.Store
	Manifests *media.Manifests
	// Purge relays overwritten or deleted public keys to the host's
	// Hooks.PurgePublic (media.HostQueue.Purge); optional.
	Purge   func(ctx context.Context, keys []string) error
	Workers int // uploads decoded at once; default 2
	// MaxPixels bounds a decoded source, all frames of an animation
	// together (default 100 MP); MaxFrames and MaxAnimationSeconds bound
	// animations (defaults 1000 and 60).
	MaxPixels           int
	MaxFrames           int
	MaxAnimationSeconds float64
	TempDir             string // zip scratch; default os.TempDir()
}

Config configures a Processor.

type DefaultPublication added in v0.68.0

type DefaultPublication struct {
	Written  []string
	Defaults []layout.Default
}

DefaultPublication is the complete fallback selection for a deployment. Written contains new immutable objects; Defaults includes existing ones too.

func PublishDefaults added in v0.62.0

func PublishDefaults(ctx context.Context, store media.Store, reg *media.Registry) (DefaultPublication, error)

PublishDefaults renders to content-addressed, create-only default objects. Deploy its mappings only after success; overlapping deploys never overwrite each other's defaults. The gateway needs no mutable pointer or manifest read.

type Processor

type Processor struct {
	// contains filtered or unexported fields
}

Processor runs image jobs. It is safe for concurrent use and idempotent: an output whose fingerprint matches is never redone (unless forced).

func New

func New(c Config) (*Processor, error)

func (*Processor) Process

func (p *Processor) Process(ctx context.Context, job media.ProcessJob) error

Process brings ref's image outputs up to date. Passes repeat until the manifest needs no more work, so a commit landing during a pass is absorbed.

Jump to

Keyboard shortcuts

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