bindcas

package
v0.1.23-oss Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const ControlDirName = ".ctrl"
View Source
const GitDirName = ".git"

Variables

This section is empty.

Functions

func ABFSHash

func ABFSHash(h hash.Hash) entities.Hash

func ABFSMode

func ABFSMode(m cas.FileMode) entities.FileMode

func ARISize

func ARISize(path string) (string, int64, error)

func BackendStat

func BackendStat(path string) (*fs.BackendStat, error)

func CASHash

func CASHash(h *entities.Hash) hash.Hash

Convert between ABFS/CAS

func CASMode

func CASMode(m entities.FileMode) cas.FileMode

func Chdir

func Chdir(path string) error

func CheckMountPoint

func CheckMountPoint(mountPoint string, force bool) error

CheckMountPoint checks if the mount point is valid for mounting. A mount-point should: 1) Should exist if not force is true. 2) Should be empty. 3) Not be already on a CASFS file-system (fuse or kmod). 4) Not be the current working directory.

func Chmod

func Chmod(path string, mode cas.FileMode) error

func CopyHashSize

func CopyHashSize(srcName, dstName string) error

func CreateControl

func CreateControl(path string) error

func CreateDir

func CreateDir(casfs CASFS, parent *casfsDir, name string) *casfsDir

func CreateGit

func CreateGit(path, directory, head string) error

func CreateGitIndex

func CreateGitIndex(path, directory, workTree, hash string) error

func CreateGitIndexFromTree

func CreateGitIndexFromTree(ctx context.Context, path, directory, worktree string, root gitindex.TreeDirectory) error

func CreateGitObjects

func CreateGitObjects(path, directory string) error

func CreateRootDir

func CreateRootDir(casfs CASFS, path string) *casfsDir

func Debug

func Debug(path string) (bool, error)

func DirEntry

func DirEntry(de entities.FileEntry) cas.DirEntry

func DirList

func DirList(path string) (entities.Hash, error)

func Dirty

func Dirty(path string) (bool, error)

func Excluded

func Excluded(path string) (bool, error)

func Getwd

func Getwd() (string, error)

func Hash

func Hash(path string) (entities.Hash, error)

func HashSize

func HashSize(path string) (entities.Hash, int64, error)

func HashStat

func HashStat(path string) (*entities.HashStat, error)
func Link(oldName, newName string) error

func Loaded

func Loaded(path string) (bool, error)

func Lstat

func Lstat(path string) (cas.FileInfo, error)

func Mkdir

func Mkdir(name string, m entities.FileMode) error

func MkdirAll

func MkdirAll(name string, m entities.FileMode) error

func Mknod

func Mknod(path string, mode entities.FileMode, rDev int) error

func MountInfoForPath

func MountInfoForPath(path string) (*procfs.Mount, error)

func OpenFile

func OpenFile(path string, flag int, mode entities.FileMode) (fs.FSFile, error)
func Readlink(path string) (string, error)

func Remove

func Remove(path string) error

func Resolve

func Resolve(s ABFSCASStore, hash entities.Hash, p string) (*cas.DirEntry, error)

func ResolveToHash

func ResolveToHash(s ABFSCASStore, hash entities.Hash, p string) (entities.Hash, error)

func SetARISize

func SetARISize(path, ari string, s int64) error

func SetDebug

func SetDebug(path string, val bool) error

func SetDeepTree

func SetDeepTree(path string, h entities.Hash) error

func SetExcluded

func SetExcluded(path string, val bool) error

func SetGlobalCASFS

func SetGlobalCASFS(fs CASFS)

func SetHash

func SetHash(path string, h entities.Hash) error

func SetHashSize

func SetHashSize(path string, h entities.Hash, s int64) error

func Stat

func Stat(path string) (cas.FileInfo, error)

func Status

func Status() (*fs.Status, error)
func Symlink(oldName, newName string) error

func Tap

func Tap(cmd *exec.Cmd) (*fs.TapCmdResult, error)

func TapResolved

func TapResolved(cmd *exec.Cmd) (*fs.TapCmdResolvedResult, error)

func WriteGitIndex

func WriteGitIndex(indexPath string, res *gitindex.Result) error

Types

type ABFSCASStore

type ABFSCASStore interface {
	CAS() cas.Store
}

type CASBackendStat

type CASBackendStat = fs.BackendStat

type CASFS

type CASFS interface {
	Getwd() (string, error)
	Chdir(path string) error
	Mkdir(name string, m entities.FileMode) error
	MkdirAll(name string, m entities.FileMode) error
	Remove(path string) error
	Symlink(oldName, newName string) error
	Readlink(path string) (string, error)
	Link(oldName, newName string) error
	Mknod(path string, mode entities.FileMode, rDev int) error
	Lstat(path string) (cas.FileInfo, error)
	Stat(path string) (cas.FileInfo, error)
	Chmod(path string, mode cas.FileMode) error
	OpenFile(path string, flag int, mode entities.FileMode) (fs.FSFile, error)
	Dirty(path string) (bool, error)
	DirList(path string) (entities.Hash, error)
	Loaded(path string) (bool, error)
	Excluded(path string) (bool, error)
	SetExcluded(path string, val bool) error
	Hash(path string) (entities.Hash, error)
	SetHash(path string, h entities.Hash) error
	HashStat(path string) (*entities.HashStat, error)
	HashSize(path string) (entities.Hash, int64, error)
	SetHashSize(path string, h entities.Hash, s int64) error
	ARISize(path string) (string, int64, error)
	SetARISize(path, ari string, s int64) error
	BackendStat(path string) (*fs.BackendStat, error)
	SetDeepTree(path string, h entities.Hash) error
	Debug(path string) (bool, error)
	SetDebug(path string, val bool) error
	CreateControl(path string) error
	CreateGit(path, directory, head string) error
	CreateGitObjects(path, directory string) error
	CreateGitIndex(path, directory, workTree, hash string) error
	CreateGitIndexFromTree(ctx context.Context, path, directory, worktree string, root gitindex.TreeDirectory) error
	WriteGitIndex(indexPath string, res *gitindex.Result) error
	Tap(cmd *exec.Cmd) (*fs.TapCmdResult, error)
	TapResolved(cmd *exec.Cmd) (*fs.TapCmdResolvedResult, error)
	Status() (*fs.Status, error)
	SetDefaultTap()
}

func NewCASFS

func NewCASFS(casapi fs.FS, fsapi fs.FSAPI) CASFS

func NewExternalCASFS

func NewExternalCASFS(mountpoint string) CASFS

type CASHashStat

type CASHashStat = fs.HashStat

type Dir

type Dir interface {
	Node
	Symlink(ctx context.Context, name, target string) (Node, error)
	MkdirAll(ctx context.Context, name string) (Dir, error)
	DeepUpdate(ctx context.Context, deepTreeHash entities.Hash) error
	CreateControl(ctx context.Context) error
	CreateGit(ctx context.Context, hash entities.Hash) error
	CreateGitObjects(ctx context.Context, name string) error
	Mknod(ctx context.Context, name string, mode entities.FileMode) (Node, error)
}

type MemFS

type MemFS interface {
	Remove(caspath string) error
	// Allow for files to be imported/exported
	FileExists(caspath string) bool
	ExportFile(caspath string, out io.Writer) error
	ImportFile(in io.Reader, caspath string) error
	// Hash root directory
	Hash() (entities.Hash, error)
}

func NewMemFS

func NewMemFS(s ABFSCASStore, hash entities.Hash) (MemFS, error)

Proivde CAS like functionality within memory and allow for files to be exported and imported from a normal filesystem. This allows for CASFS like operations without having to do a full filesystem mount.

type Node

type Node interface {
	Path() string
	SetExcluded(context.Context, bool) error
}

Jump to

Keyboard shortcuts

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