webcarry

package
v0.41.8 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package webcarry layers the hashed web assets of other builds under the embedded bundle. It is separate from internal/web so that packages that only need the overlay (and their tests) do not import the //go:embed package, which needs a built dist directory.

Index

Constants

View Source
const DefaultCarryDir = "/app/web-carry"

The carry directory holds the hashed /assets/ files of other builds, so a browser that loaded index.html from one version of the app can still fetch its chunks from a pod running another during a rolling update (and a tab left open across a deploy can fetch a chunk it had not loaded yet). The image build fills it (scripts/web-carry.sh: the last 48 hours of main builds plus the last two final releases, taken from their registry images), next to a MANIFEST.json. The server reads it only for a file the embedded build lacks, only for a hashed asset name, and never lists it: nothing here can change what an existing path serves or reveal what is in the directory.

Variables

This section is empty.

Functions

This section is empty.

Types

type CarryInfo

type CarryInfo struct {
	// Files is how many assets the manifest lists.
	Files int
	// Missing names the sources the build could not copy (a failed pull, or an image from before the carry existed); the build stays green and
	// flags it. rivolt_web_carry_missing_sources exports its length.
	Missing []string
}

CarryInfo is what the build recorded about the carry directory (its MANIFEST.json); zero when there is none.

func WithCarry

func WithCarry(base fs.FS, dir string) (fs.FS, CarryInfo)

WithCarry layers dir under base: a file base has is base's; a hashed asset base lacks is read from dir if it is a regular file there. When dir does not exist (a self-hosted build, a dev run) base is returned as it is.

Jump to

Keyboard shortcuts

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