storage

package
v0.0.0-...-094e3b7 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package storage defines the persistent storage of snapshots.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalFiles

type LocalFiles struct {
	ArchiveDir string
}

LocalFiles implementes the `snapshot.Storage` interface using the local file system.

It is used to write and read snapshots to persistent storage.

func (*LocalFiles) CachePathInfo

func (s *LocalFiles) CachePathInfo(ctx context.Context, p snapshot.Path, info os.FileInfo) error

func (*LocalFiles) Exclude

func (s *LocalFiles) Exclude(p snapshot.Path) bool

Exclude reports whether or not the given path should be excluded from snapshotting.

This should return true for any paths that are part of the underlying persistent storage.

func (*LocalFiles) FindSnapshot

func (s *LocalFiles) FindSnapshot(ctx context.Context, p snapshot.Path) (*snapshot.Hash, *snapshot.File, error)

func (*LocalFiles) LatestSignatureForIdentity

func (s *LocalFiles) LatestSignatureForIdentity(ctx context.Context, id *snapshot.Identity) (*snapshot.Hash, error)

func (*LocalFiles) ListDirectorySnapshotContents

func (s *LocalFiles) ListDirectorySnapshotContents(ctx context.Context, h *snapshot.Hash, f *snapshot.File) (snapshot.Tree, error)

ListDirectorySnapshotContents returns the parsed `*snapshot.Tree` object listing the contents of `f`.

The supplied `*snapshot.File` object must correspond to a directory.

func (*LocalFiles) PathInfoMatchesCache

func (s *LocalFiles) PathInfoMatchesCache(ctx context.Context, p snapshot.Path, info os.FileInfo) bool

func (*LocalFiles) ReadObject

func (s *LocalFiles) ReadObject(ctx context.Context, h *snapshot.Hash) (io.ReadCloser, error)

func (*LocalFiles) ReadSnapshot

func (s *LocalFiles) ReadSnapshot(ctx context.Context, h *snapshot.Hash) (*snapshot.File, error)

func (*LocalFiles) RemoveMappingForPath

func (s *LocalFiles) RemoveMappingForPath(ctx context.Context, p snapshot.Path) error

func (*LocalFiles) StoreObject

func (s *LocalFiles) StoreObject(ctx context.Context, size int64, reader io.Reader) (h *snapshot.Hash, err error)

func (*LocalFiles) StoreSnapshot

func (s *LocalFiles) StoreSnapshot(ctx context.Context, p snapshot.Path, f *snapshot.File) (*snapshot.Hash, error)

func (*LocalFiles) UpdateSignatureForIdentity

func (s *LocalFiles) UpdateSignatureForIdentity(ctx context.Context, id *snapshot.Identity, h *snapshot.Hash) error

Jump to

Keyboard shortcuts

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