filesystem

package
v0.3.33 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package filesystem implements cap/filesystem.Service over the local disk (filesystem/local) and host-absolute atomic replace for runtime sidecars that already hold a resolved path.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New added in v0.3.33

func New(cfg Config, deps Deps) (capfs.Service, error)

New registers filesystem/local: local-disk cap/filesystem.Service over workspace.Resolve.

func TrimRedundantFSRootPrefix added in v0.3.33

func TrimRedundantFSRootPrefix(fsRoot, path string) string

TrimRedundantFSRootPrefix drops a leading fsRoot/ prefix when the fs store root is already fsRoot. Used by filesystem/local when models pass paths like work/upload/foo while config.root is work.

func WriteAtomic added in v0.3.33

func WriteAtomic(path string, data []byte, perm os.FileMode) error

WriteAtomic replaces path with data via a temp file in the same directory.

Types

type Config added in v0.3.33

type Config struct {
	// Root is directory relative to the workspace root; may use global: or local: prefix.
	Root string `json:"root"`
	// Unrestricted disables path confinement to Root (absolute paths and .. are allowed).
	Unrestricted bool `json:"unrestricted,omitempty"`
}

Config is filesystem/local: a workspace-rooted disk store.

type Deps added in v0.3.33

type Deps struct {
	Workspace workspace.Service `json:"workspace"`
}

Deps for filesystem/local.

type IgnoreMatcher

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

IgnoreMatcher applies .gitignore-style patterns relative to a workspace root.

func LoadIgnoreMatcher

func LoadIgnoreMatcher(workspaceRoot string) (*IgnoreMatcher, error)

LoadIgnoreMatcher reads the workspace-root .gitignore when present and always ignores .git, node_modules, and .env.

func (*IgnoreMatcher) Ignored

func (m *IgnoreMatcher) Ignored(relPath string, isDir bool) bool

Ignored reports whether relPath (slash-separated, relative to workspace root) should be skipped during directory walks.

Jump to

Keyboard shortcuts

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