snapshot

package
v0.4.11-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2023 License: ISC Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBlob

func GetBlob(repository *storage.Repository, checksum [32]byte) ([]byte, error)

func GetFilesystem

func GetFilesystem(repository *storage.Repository, checksum [32]byte) (*vfs.Filesystem, [32]byte, error)

func GetIndex

func GetIndex(repository *storage.Repository, checksum [32]byte) (*index.Index, [32]byte, error)

func GetLock

func GetLock(repository *storage.Repository, lockID uuid.UUID) (*locking.Lock, error)

func GetMetadata

func GetMetadata(repository *storage.Repository, checksum [32]byte) (*metadata.Metadata, [32]byte, error)

func GetRepositoryIndex

func GetRepositoryIndex(repository *storage.Repository, checksum [32]byte) (*storageIndex.Index, error)

func GetSnapshot

func GetSnapshot(repository *storage.Repository, indexID uuid.UUID) (*header.Header, bool, error)

func List

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

func PutLock

func PutLock(repository storage.Repository, lock *locking.Lock) (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 PackerChunkMsg

type PackerChunkMsg struct {
	Checksum [32]byte
	Data     []byte
}

type PackerObjectMsg

type PackerObjectMsg struct {
	Checksum [32]byte
	Data     []byte
}

type Reader

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

func NewReader

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

func (*Reader) Close

func (reader *Reader) Close() error

func (*Reader) GetContentType

func (reader *Reader) GetContentType() string

func (*Reader) Read

func (reader *Reader) Read(buf []byte) (int, error)

func (*Reader) Seek

func (reader *Reader) Seek(offset int64, whence int) (int64, error)

type Snapshot

type Snapshot struct {
	SkipDirs []string

	Header     *header.Header
	Index      *index.Index
	Filesystem *vfs.Filesystem
	Metadata   *metadata.Metadata
	// 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) (bool, error)

func (*Snapshot) CheckChunk

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

func (*Snapshot) CheckObject

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

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) Lock

func (snapshot *Snapshot) Lock() error

func (*Snapshot) NewReader

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

func (*Snapshot) Pull

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

func (*Snapshot) Push

func (snapshot *Snapshot) Push(scanDir string) error

func (*Snapshot) PutBlob

func (snapshot *Snapshot) PutBlob(checksum [32]byte, data []byte) (int, 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) error

func (*Snapshot) PutIndex

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

func (*Snapshot) PutObject

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

func (*Snapshot) PutPackfile

func (snapshot *Snapshot) PutPackfile(pack *packfile.PackFile, objects [][32]byte, chunks [][32]byte) error

func (*Snapshot) Repository

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

func (*Snapshot) Unlock

func (snapshot *Snapshot) Unlock() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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