inputfs

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 10 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 inputfs provides the retained, read-only input root used during preparation. Version 1 supports Linux; every path component is opened relative to a retained descriptor with O_NOFOLLOW, including symlinks whose targets remain in the root.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Root

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

Root retains the identity of one input directory until Close. Its methods are safe for concurrent use; callers must keep it open throughout preparation.

func FromDirectory

func FromDirectory(file *os.File) (*Root, error)

FromDirectory retains its own duplicate of a trusted, already-open directory. The caller retains ownership of file. Descendant reads retain Open's confined no-symlink semantics; this constructor does not resolve a pathname.

func Open

func Open(name string) (*Root, error)

Open retains an existing directory without following any symlink component. Renaming or replacing the original root pathname does not redirect reads.

func (*Root) Close

func (r *Root) Close() error

Close releases the retained root. It must be called after its readers finish.

func (*Root) OpenRegular

func (r *Root) OpenRegular(ctx context.Context, name string) (io.ReadCloser, error)

OpenRegular opens only a regular file, rejecting all symlink components and special files. Reads preserve InputError classification and check cancellation.

func (*Root) ReadDir

func (r *Root) ReadDir(ctx context.Context, name string) ([]contracts.InputEntry, error)

ReadDir returns every entry, including hidden names, in byte-sorted order. It rejects symlinks and special entries instead of silently filtering them.

func (*Root) Stat

func (r *Root) Stat() (os.FileInfo, error)

Stat returns the retained directory identity, even if its pathname has moved. Publication uses this identity to keep output outside the actual input root.

Jump to

Keyboard shortcuts

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