vaultfs

package
v0.8.13 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT 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 vaultfs provides capability-scoped access to files beneath a vault.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogicalFileError added in v0.7.0

type LogicalFileError struct {
	Code string `json:"code"`
}

func (*LogicalFileError) Error added in v0.7.0

func (e *LogicalFileError) Error() string

type LogicalFileMetadata added in v0.7.0

type LogicalFileMetadata struct {
	Exists    bool  `json:"exists"`
	Regular   bool  `json:"regular"`
	SizeBytes int64 `json:"size_bytes"`
}

type PrivateTemp added in v0.7.0

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

PrivateTemp is a generated, root-confined temporary directory. It only creates private regular files and removes the entire generated directory on cleanup.

func NewPrivateTemp added in v0.7.0

func NewPrivateTemp(base string) (*PrivateTemp, error)

NewPrivateTemp creates a generated 0700 directory below an existing, non-symlinked temporary root.

func (*PrivateTemp) AvailableBytes added in v0.7.0

func (t *PrivateTemp) AvailableBytes() (uint64, error)

AvailableBytes returns the current free-space estimate for the temp volume.

func (*PrivateTemp) Cleanup added in v0.7.0

func (t *PrivateTemp) Cleanup() error

Cleanup closes capabilities and removes the generated directory. It is safe to call more than once.

func (*PrivateTemp) Create added in v0.7.0

func (t *PrivateTemp) Create(name string) (*os.File, error)

Create creates a new 0600 file directly beneath the generated directory.

func (*PrivateTemp) Dir added in v0.7.0

func (t *PrivateTemp) Dir() string

Dir returns the generated directory path for local cleanup diagnostics only.

func (*PrivateTemp) Open added in v0.7.0

func (t *PrivateTemp) Open(name string) (*os.File, error)

Open opens an existing regular file through the held root capability. It never resolves the generated directory or file again by pathname.

type Root

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

Root confines filesystem operations to a vault directory. Path containment, including symlink resolution, is enforced by os.Root at the operation.

func Open

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

Open opens dir as a capability root.

func (*Root) Close

func (r *Root) Close() error

Close releases the operating-system handle for the root.

func (*Root) Inspect added in v0.7.0

func (r *Root) Inspect(name string) (LogicalFileMetadata, error)

func (*Root) MkdirAll

func (r *Root) MkdirAll(name string, perm os.FileMode) error

MkdirAll creates name and missing parents beneath the root.

func (*Root) Open

func (r *Root) Open(name string) (*os.File, error)

Open opens name for reading beneath the root.

func (*Root) ReadFile

func (r *Root) ReadFile(name string) ([]byte, error)

ReadFile reads name beneath the root.

func (*Root) Remove

func (r *Root) Remove(name string) error

Remove removes name beneath the root.

func (*Root) Stat

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

Stat returns information about name beneath the root.

func (*Root) WriteFile

func (r *Root) WriteFile(name string, data []byte, perm os.FileMode) error

WriteFile writes name beneath the root.

Jump to

Keyboard shortcuts

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