htfs

package
v0.0.0-...-a79fb06 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateTreeStats

func CalculateTreeStats() (Dirtask, *TreeStats)

func CatalogLoader

func CatalogLoader(catalog string, at int, roots Roots) anywork.Work

func CatalogName

func CatalogName(key string) string

func CatalogNames

func CatalogNames() []string

func CleanupHolotreeStage

func CleanupHolotreeStage(tree MutableLibrary) error

func ComposeFinalBlueprint

func ComposeFinalBlueprint(userFiles []string, packfile string) (config robot.Robot, blueprint []byte, err error)

func Compress

func Compress() bool

func ControllerSpaceName

func ControllerSpaceName(client, tag []byte) string

func DigestLoader

func DigestLoader(root *Root, at int, slots []map[string]string) anywork.Work

func DropFile

func DropFile(library Library, digest, sinkname string, details *File, rewrite []byte) anywork.Work

func ExactDefaultLocation

func ExactDefaultLocation(digest string) string

func LiftFile

func LiftFile(sourcename, sinkname string, compress bool) anywork.Work

func LoadHololibHashes

func LoadHololibHashes() (map[string]map[string]bool, map[string]map[string]bool)

func MakeBranches

func MakeBranches(path string, it *Dir) error

func NewEnvironment

func NewEnvironment(condafile, holozip string, restore, force bool, puller CatalogPuller) (label string, scorecard common.Scorecard, err error)

func RecordEnvironment

func RecordEnvironment(tree MutableLibrary, blueprint []byte, force bool, scorecard common.Scorecard, puller CatalogPuller) (err error)

func RelativeDefaultLocation

func RelativeDefaultLocation(digest string) string

func RemoveDirectory

func RemoveDirectory(dirname string) anywork.Work

func RemoveFile

func RemoveFile(filename string) anywork.Work

func RestoreLayersTo

func RestoreLayersTo(tree MutableLibrary, identityfile string, targetDir string) conda.SkipLayer

func RobotBlueprints

func RobotBlueprints(userBlueprints []string, packfile string) (robot.Robot, []string)

func UserHolotreeLockfile

func UserHolotreeLockfile() string

Types

type CatalogPuller

type CatalogPuller func(string, string, bool) error

type Closer

type Closer func() error

type Dir

type Dir struct {
	Name    string           `json:"name"`
	Symlink string           `json:"symlink,omitempty"`
	Mode    fs.FileMode      `json:"mode"`
	Dirs    map[string]*Dir  `json:"subdirs"`
	Files   map[string]*File `json:"files"`
	Shadow  bool             `json:"shadow,omitempty"`
}

func (*Dir) AllDirs

func (it *Dir) AllDirs(path string, task Dirtask)

func (*Dir) AllFiles

func (it *Dir) AllFiles(path string, task Filetask)
func (it *Dir) IsSymlink() bool

func (*Dir) Lift

func (it *Dir) Lift(path string) error

func (*Dir) Show

func (it *Dir) Show(path []string, fullpath string) ([]byte, error)

type Dirtask

type Dirtask func(string, *Dir) anywork.Work

func RestoreDirectory

func RestoreDirectory(library Library, fs *Root, current map[string]string, stats *stats) Dirtask

type File

type File struct {
	Name    string      `json:"name"`
	Symlink string      `json:"symlink,omitempty"`
	Size    int64       `json:"size"`
	Mode    fs.FileMode `json:"mode"`
	Digest  string      `json:"digest"`
	Rewrite []int64     `json:"rewrite"`
}
func (it *File) IsSymlink() bool

func (*File) Match

func (it *File) Match(info fs.FileInfo) bool

type Filetask

type Filetask func(string, *File) anywork.Work

func CheckHasher

func CheckHasher(known map[string]map[string]bool) Filetask

func Locator

func Locator(seek string) Filetask

type Info

type Info struct {
	RccVersion string `json:"rcc"`
	Identity   string `json:"identity"`
	Path       string `json:"path"`
	Controller string `json:"controller"`
	Space      string `json:"space"`
	Platform   string `json:"platform"`
	Blueprint  string `json:"blueprint"`
}

func NewInfo

func NewInfo(path string) (*Info, error)

func (*Info) AsJson

func (it *Info) AsJson() ([]byte, error)

type Library

type Library interface {
	ValidateBlueprint([]byte) error
	HasBlueprint([]byte) bool
	Open(string) (io.Reader, Closer, error)
	WarrantyVoidedDir([]byte, []byte) string
	TargetDir([]byte, []byte, []byte) (string, error)
	Restore([]byte, []byte, []byte) (string, error)
	RestoreTo([]byte, string, string, string, bool) (string, error)
}

func ZipLibrary

func ZipLibrary(zipfile string) (Library, error)

type MutableLibrary

type MutableLibrary interface {
	Library

	Identity() string
	ExactLocation(string) string
	Export([]string, []string, string) error
	Remove([]string) error
	Location(string) string
	Record([]byte) error
	Stage() string
	CatalogPath(string) string
	WriteIdentity([]byte) error
}

func New

func New() (MutableLibrary, error)

func Unmanaged

func Unmanaged(core MutableLibrary) MutableLibrary

func Virtual

func Virtual() MutableLibrary

type Root

type Root struct {
	*Info
	Lifted bool `json:"lifted"`
	Tree   *Dir `json:"tree"`
	// contains filtered or unexported fields
}

func NewRoot

func NewRoot(path string) (*Root, error)

func (*Root) AllDirs

func (it *Root) AllDirs(task Dirtask) error

func (*Root) AllFiles

func (it *Root) AllFiles(task Filetask) error

func (*Root) AsJson

func (it *Root) AsJson() ([]byte, error)

func (*Root) HolotreeBase

func (it *Root) HolotreeBase() string

func (*Root) Lift

func (it *Root) Lift() error

func (*Root) LoadFrom

func (it *Root) LoadFrom(filename string) error

func (*Root) ReadFrom

func (it *Root) ReadFrom(source io.Reader) error

func (*Root) Relocate

func (it *Root) Relocate(target string) error

func (*Root) Rewrite

func (it *Root) Rewrite() []byte

func (*Root) SaveAs

func (it *Root) SaveAs(filename string) error

func (*Root) Show

func (it *Root) Show(filename string) ([]byte, error)

func (*Root) Signature

func (it *Root) Signature() uint64

func (*Root) Source

func (it *Root) Source() string

func (*Root) Stats

func (it *Root) Stats() (*TreeStats, error)

func (*Root) Top

func (it *Root) Top(count int) map[string]int64

func (*Root) Touch

func (it *Root) Touch()

func (*Root) Treetop

func (it *Root) Treetop(task Treetop) error

type Roots

type Roots []*Root

func LoadCatalogs

func LoadCatalogs() ([]string, Roots)

func (Roots) BaseFolders

func (it Roots) BaseFolders() []string

func (Roots) FindEnvironments

func (it Roots) FindEnvironments(fragments []string) []string

func (Roots) InstallationPlan

func (it Roots) InstallationPlan(hash string) (string, bool)

func (Roots) RemoveHolotreeSpace

func (it Roots) RemoveHolotreeSpace(label string) (err error)

func (Roots) Spacemap

func (it Roots) Spacemap() map[string]string

func (Roots) Spaces

func (it Roots) Spaces() Roots

type TreeStats

type TreeStats struct {
	sync.Mutex
	Directories uint64
	Files       uint64
	Bytes       uint64
	Identity    string
	Relocations uint64
}

type Treetop

type Treetop func(string, *Dir) error

func CatalogCheck

func CatalogCheck(library MutableLibrary, fs *Root) Treetop

func DigestMapper

func DigestMapper(target map[string]string) Treetop

func DigestRecorder

func DigestRecorder(target map[string]string) Treetop

func IntegrityCheck

func IntegrityCheck(result map[string]string, needed map[string]map[string]bool) Treetop

func ScheduleLifters

func ScheduleLifters(library MutableLibrary, stats *stats) Treetop

func ZipIgnore

func ZipIgnore(library MutableLibrary, fs *Root, sink Zipper) Treetop

func ZipRoot

func ZipRoot(library MutableLibrary, fs *Root, sink Zipper) Treetop

type WriteLocator

type WriteLocator interface {
	io.Writer
	Locations() []int64
}

func RelocateWriter

func RelocateWriter(delegate io.Writer, needle string) WriteLocator

type Zipper

type Zipper interface {
	Ignore(relativepath string)
	Add(fullpath, relativepath string) error
}

Jump to

Keyboard shortcuts

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