snapshot

package
v0.4.25-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: ISC Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArchiveTar     ArchiveFormat = "tar"
	ArchiveTarball               = "tarball"
	ArchiveZip                   = "zip"
)
View Source
const SIGNATURE_VERSION = "1.0.0"

Variables

View Source
var (
	ErrInvalidArchiveFormat = errors.New("unknown archive format")
	ErrNotADirectory        = errors.New("is not a directory")
)
View Source
var (
	ErrNotFound = errors.New("snapshot not found")
)
View Source
var (
	ErrReadOnly = errors.New("read-only store")
)

Functions

func GetSnapshot

func GetSnapshot(repo *repository.Repository, Identifier objects.MAC) (*header.Header, bool, error)

func NewReader

func NewReader(snap *Snapshot, pathname string) (io.ReadCloser, error)

Types

type ArchiveFormat

type ArchiveFormat = string

type BackupContext

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

type BackupOptions

type BackupOptions struct {
	MaxConcurrency uint64
	Name           string
	Tags           []string
	Excludes       []glob.Glob
}

type CheckOptions

type CheckOptions struct {
	MaxConcurrency uint64
	FastCheck      bool
}

type Packer

type Packer struct {
	Blobs    map[resources.Type]map[[32]byte][]byte
	Packfile *packfile.PackFile
}

func NewPacker

func NewPacker(hasher hash.Hash) *Packer

func (*Packer) AddBlob

func (packer *Packer) AddBlob(Type resources.Type, version versioning.Version, mac [32]byte, data []byte, flags uint32)

func (*Packer) Size

func (packer *Packer) Size() uint32

func (*Packer) Types

func (packer *Packer) Types() []resources.Type

type PackerMsg

type PackerMsg struct {
	Timestamp time.Time
	Type      resources.Type
	Version   versioning.Version
	MAC       objects.MAC
	Data      []byte
	Flags     uint32
}

type RestoreOptions

type RestoreOptions struct {
	MaxConcurrency uint64
	Rebase         bool
}

type Snapshot

type Snapshot struct {
	SkipDirs []string

	Header *header.Header
	// contains filtered or unexported fields
}

func Clone

func Clone(repo *repository.Repository, Identifier objects.MAC) (*Snapshot, error)

func Fork

func Fork(repo *repository.Repository, Identifier objects.MAC) (*Snapshot, error)

func Load

func Load(repo *repository.Repository, Identifier objects.MAC) (*Snapshot, error)

func New

func New(repo *repository.Repository) (*Snapshot, error)

func (*Snapshot) AppContext

func (snap *Snapshot) AppContext() *appcontext.AppContext

func (*Snapshot) Archive

func (snap *Snapshot) Archive(w io.Writer, format ArchiveFormat, paths []string, rebase bool) error

func (*Snapshot) Backup

func (snap *Snapshot) Backup(scanDir string, imp importer.Importer, options *BackupOptions) error

func (*Snapshot) BlobExists

func (snap *Snapshot) BlobExists(Type resources.Type, mac [32]byte) bool

func (*Snapshot) Check

func (snap *Snapshot) Check(pathname string, opts *CheckOptions) (bool, error)

func (*Snapshot) Close

func (snap *Snapshot) Close() error

func (*Snapshot) Commit

func (snap *Snapshot) Commit() error

func (*Snapshot) Event

func (snap *Snapshot) Event(evt events.Event)

func (*Snapshot) Filesystem

func (s *Snapshot) Filesystem() (*vfs.Filesystem, error)

func (*Snapshot) GetBlob

func (snap *Snapshot) GetBlob(Type resources.Type, mac [32]byte) ([]byte, error)

func (*Snapshot) ListChunks

func (snap *Snapshot) ListChunks() (iter.Seq2[objects.MAC, error], error)

func (*Snapshot) ListObjects

func (snap *Snapshot) ListObjects() (iter.Seq2[objects.MAC, error], error)

func (*Snapshot) Logger

func (snap *Snapshot) Logger() *logging.Logger

func (*Snapshot) LookupObject

func (snap *Snapshot) LookupObject(mac objects.MAC) (*objects.Object, error)

func (*Snapshot) NewReader

func (snapshot *Snapshot) NewReader(pathname string) (io.ReadCloser, error)

func (*Snapshot) PutBlob

func (snap *Snapshot) PutBlob(Type resources.Type, mac [32]byte, data []byte) error

func (*Snapshot) PutPackfile

func (snap *Snapshot) PutPackfile(packer *Packer) error

func (*Snapshot) Repository

func (snap *Snapshot) Repository() *repository.Repository

func (*Snapshot) Restore

func (snap *Snapshot) Restore(exp exporter.Exporter, base string, pathname string, opts *RestoreOptions) error

func (*Snapshot) Verify

func (snap *Snapshot) Verify() (bool, error)

type SnapshotStore

type SnapshotStore[K any, V any] struct {
	// contains filtered or unexported fields
}

RepositoryStore implements btree.Storer

func (*SnapshotStore[K, V]) Get

func (s *SnapshotStore[K, V]) Get(sum objects.MAC) (*btree.Node[K, objects.MAC, V], error)

func (*SnapshotStore[K, V]) Put

func (s *SnapshotStore[K, V]) Put(node *btree.Node[K, objects.MAC, V]) (objects.MAC, error)

func (*SnapshotStore[K, V]) Update

func (s *SnapshotStore[K, V]) Update(sum objects.MAC, node *btree.Node[K, objects.MAC, V]) error

Directories

Path Synopsis
fs
s3
fs
ftp
s3

Jump to

Keyboard shortcuts

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