privatefile

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package privatefile provides dependency-minimal owner-only atomic writes for sensitive artifacts used below the config/util dependency layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(path string, data []byte) error

Write atomically replaces path with owner-only bytes. A missing parent is created at 0700. Existing parent modes are never changed because path may be an operator-selected location. Symlinks and filesystems that cannot replace an anchored inode fall back to a chmod-before-truncate write.

func WriteAnchored

func WriteAnchored(path string, data []byte) error

WriteAnchored preserves an existing target inode. Use it for operator-owned config and credential files that may be bind-mounted, symlinked, hard-linked, or writable while their parent directory is not. Fresh files still use the atomic Write path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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