snapshot

package
v0.2.6-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: ISC Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFilesystem

func GetFilesystem(repository *storage.Repository, indexID uuid.UUID) (*vfs.Filesystem, []byte, error)

func GetIndex

func GetIndex(repository *storage.Repository, indexID uuid.UUID) (*index.Index, []byte, error)

func GetMetadata

func GetMetadata(repository *storage.Repository, indexID uuid.UUID) (*metadata.Metadata, bool, error)

func List

func List(repository *storage.Repository) ([]uuid.UUID, error)

Types

type CachedObject

type CachedObject struct {
	Checksum    [32]byte
	Chunks      []*objects.Chunk
	ContentType string
	Info        vfs.FileInfo
}

CachedObject needs to be killed

type Snapshot

type Snapshot struct {
	SkipDirs []string

	Metadata   *metadata.Metadata
	Index      *index.Index
	Filesystem *vfs.Filesystem
	// contains filtered or unexported fields
}

func Fork

func Fork(repository *storage.Repository, indexID uuid.UUID) (*Snapshot, error)

func Load

func Load(repository *storage.Repository, indexID uuid.UUID) (*Snapshot, error)

func New

func New(repository *storage.Repository, indexID uuid.UUID) (*Snapshot, error)

func (*Snapshot) Check

func (snapshot *Snapshot) Check(resource string, fast bool, showProgress bool) (bool, error)

func (*Snapshot) CheckChunk

func (snapshot *Snapshot) CheckChunk(checksum [32]byte) (bool, error)

func (*Snapshot) CheckObject

func (snapshot *Snapshot) CheckObject(checksum [32]byte) (bool, error)

func (*Snapshot) Commit

func (snapshot *Snapshot) Commit() error

func (*Snapshot) GetCachedObject

func (snapshot *Snapshot) GetCachedObject(pathname string) (*CachedObject, error)

func (*Snapshot) GetChunk

func (snapshot *Snapshot) GetChunk(checksum [32]byte) ([]byte, error)

func (*Snapshot) GetObject

func (snapshot *Snapshot) GetObject(checksum [32]byte) (*objects.Object, error)

func (*Snapshot) NewReader

func (snapshot *Snapshot) NewReader(pathname string) (*storage.Reader, error)

func (*Snapshot) Pull

func (snapshot *Snapshot) Pull(root string, rebase bool, pattern string, showProgress bool)

func (*Snapshot) Push

func (snapshot *Snapshot) Push(scanDir string, showProgress bool) error

func (*Snapshot) PutCachedObject

func (snapshot *Snapshot) PutCachedObject(pathname string, object objects.Object, fi vfs.FileInfo) error

func (*Snapshot) PutChunk

func (snapshot *Snapshot) PutChunk(checksum [32]byte, data []byte) (int, error)

func (*Snapshot) PutFilesystem

func (snapshot *Snapshot) PutFilesystem(data []byte) (int, error)

func (*Snapshot) PutIndex

func (snapshot *Snapshot) PutIndex(data []byte) (int, error)

func (*Snapshot) PutMetadata

func (snapshot *Snapshot) PutMetadata(data []byte) (int, error)

func (*Snapshot) PutObject

func (snapshot *Snapshot) PutObject(object *objects.Object) (int, error)

func (*Snapshot) Repository

func (snapshot *Snapshot) Repository() *storage.Repository

Jump to

Keyboard shortcuts

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