filesystem

package
v0.35.1 Latest Latest
Warning

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

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

Documentation

Overview

Package filesystem owns root-confined production filesystem access.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handle

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

Handle provides root-confined filesystem operations.

func Open

func Open(root string) (*Handle, error)

Open opens root as a root-confined filesystem handle.

func (*Handle) Chmod added in v0.35.1

func (h *Handle) Chmod(path string, mode fs.FileMode) error

Chmod changes path's permission mode beneath the selected root.

func (*Handle) Close

func (h *Handle) Close() error

Close closes the root-confined filesystem handle.

func (*Handle) Info

func (h *Handle) Info(path string) (fs.FileInfo, error)

Info returns metadata for path, following a final symbolic link.

func (*Handle) LinkInfo

func (h *Handle) LinkInfo(path string) (fs.FileInfo, error)

LinkInfo returns metadata for path without following a final symbolic link.

func (*Handle) MkdirAll added in v0.34.0

func (h *Handle) MkdirAll(path string, mode fs.FileMode) error

MkdirAll creates path and missing parents beneath the selected root.

func (*Handle) Publish added in v0.34.0

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

Publish atomically publishes one complete file without replacement beneath the selected root.

func (*Handle) Read

func (h *Handle) Read(path string) ([]byte, error)

Read reads path beneath the selected root.

func (*Handle) ReadWithMode added in v0.35.1

func (h *Handle) ReadWithMode(path string) ([]byte, fs.FileMode, error)

ReadWithMode reads path and returns its permission mode from one confined open.

func (*Handle) Remove added in v0.34.0

func (h *Handle) Remove(path string) error

Remove removes path beneath the selected root.

func (*Handle) Replace added in v0.34.0

func (h *Handle) Replace(destination string, contents []byte, mode fs.FileMode) (returnErr error)

Replace atomically replaces path with one complete file beneath the selected root, preserving the requested final mode.

func (*Handle) Walk

func (h *Handle) Walk(subtree string, visit func(path string, info fs.FileInfo) (bool, error)) error

Walk visits subtree entries with metadata describing each entry itself.

Jump to

Keyboard shortcuts

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