Documentation
¶
Overview ¶
Package filesystem owns root-confined production filesystem access.
Index ¶
- func Backup(source string, readWithMode func(string) ([]byte, fs.FileMode, error), ...) (string, error)
- type Handle
- func (h *Handle) Backup(source string) (string, error)
- func (h *Handle) Chmod(path string, mode fs.FileMode) error
- func (h *Handle) Close() error
- func (h *Handle) Info(path string) (fs.FileInfo, error)
- func (h *Handle) LinkInfo(path string) (fs.FileInfo, error)
- func (h *Handle) MkdirAll(path string, mode fs.FileMode) error
- func (h *Handle) Publish(path string, contents []byte, mode fs.FileMode) error
- func (h *Handle) Read(path string) ([]byte, error)
- func (h *Handle) ReadWithMode(path string) ([]byte, fs.FileMode, error)
- func (h *Handle) Remove(path string) error
- func (h *Handle) Replace(destination string, contents []byte, mode fs.FileMode) (returnErr error)
- func (h *Handle) Walk(subtree string, visit func(path string, info fs.FileInfo) (bool, error)) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handle ¶
type Handle struct {
// contains filtered or unexported fields
}
Handle provides root-confined filesystem operations.
func (*Handle) Backup ¶ added in v0.36.0
Backup reads source once, preserving its permission mode, then exclusively publishes a complete sibling backup at source.awf-bak or its first available numbered suffix. The supplied confined callbacks keep source access and publication policy with the caller while this package owns the shared naming and collision protocol. Backup copies a source beneath this handle to its first free sibling backup.
func (*Handle) Chmod ¶ added in v0.35.1
Chmod changes path's permission mode beneath the selected root.
func (*Handle) LinkInfo ¶
LinkInfo returns metadata for path without following a final symbolic link.
func (*Handle) MkdirAll ¶ added in v0.34.0
MkdirAll creates path and missing parents beneath the selected root.
func (*Handle) Publish ¶ added in v0.34.0
Publish atomically publishes one complete file without replacement beneath the selected root.
func (*Handle) ReadWithMode ¶ added in v0.35.1
ReadWithMode reads path and returns its permission mode from one confined open.