publish

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package publish stages and commits generated artifact generations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Recover

func Recover(target string) error

Recover repairs publication debris left by an interrupted process. If a target vanished after its old generation was backed up, the newest backup is restored. Otherwise obsolete backups and stages are removed.

Types

type Transaction

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

Transaction owns same-filesystem staging paths for one or more generated directories or files. Commit replaces all targets and rolls every completed replacement back if a later replacement fails.

func (*Transaction) Abort

func (tx *Transaction) Abort()

Abort removes uncommitted staging paths. It is safe to call with defer.

func (*Transaction) Commit

func (tx *Transaction) Commit() error

Commit replaces every target. Existing targets are retained as backups until every replacement succeeds, then removed. A failed replacement restores the earlier generation before returning.

func (*Transaction) StageDirectory

func (tx *Transaction) StageDirectory(target string) (string, error)

StageDirectory creates an empty sibling staging directory for target.

func (*Transaction) StageFile

func (tx *Transaction) StageFile(target string) (string, error)

StageFile creates a sibling staging file path for target. The empty file is ready for a generator or compiler to overwrite.

Jump to

Keyboard shortcuts

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