filepublication

package
v0.36.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package filepublication owns complete same-directory file preparation and released-platform atomic no-replace namespace publication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MoveNoReplace

func MoveNoReplace(fromPath, toPath string) error

MoveNoReplace atomically moves one filesystem entry to an absent destination. It never copies, traverses, or replaces either entry.

func Publish

func Publish(path string, contents []byte, mode fs.FileMode) error

Publish writes contents with mode to a same-directory temporary file and atomically creates path only when it is absent.

func PublishConfined added in v0.34.0

func PublishConfined(root confinedRoot, destination string, contents []byte, mode fs.FileMode) error

PublishConfined prepares and publishes a complete file through root-confined operations. Link supplies the atomic no-replace namespace operation: the complete temporary inode becomes visible at path only when path is absent.

Types

type CommittedCleanupError added in v0.34.0

type CommittedCleanupError struct {
	DestinationPath string
	ResiduePath     string
	Cause           error
}

CommittedCleanupError reports that destination was committed but its same-directory publication temporary could not be removed.

func (*CommittedCleanupError) Error added in v0.34.0

func (e *CommittedCleanupError) Error() string

func (*CommittedCleanupError) Unwrap added in v0.34.0

func (e *CommittedCleanupError) Unwrap() error

Unwrap preserves the cleanup failure identity.

Jump to

Keyboard shortcuts

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