session

package
v0.0.0-...-3cef9f2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ManifestPrefix = "manifests/"
)

Variables

View Source
var ErrNotFound = fmt.Errorf("file not found")

Functions

This section is empty.

Types

type ListEntry

type ListEntry struct {
	Path   string
	Prefix bool
	Meta   *manifest.Metadata
	// contains filtered or unexported fields
}

func (*ListEntry) Stream

func (e *ListEntry) Stream(ctx context.Context) (*streams.Stream, error)

type Manager

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

func NewManager

func NewManager(backend backends.Backend, blobStore *blobs.Store, hashes *hashdb.DB) *Manager

func (*Manager) DeleteSnapshot

func (s *Manager) DeleteSnapshot(ctx context.Context, timestamp time.Time) error

func (*Manager) LatestSnapshot

func (s *Manager) LatestSnapshot(ctx context.Context) (*Snapshot, time.Time, error)

func (*Manager) ListSnapshots

func (s *Manager) ListSnapshots(ctx context.Context,
	cb func(ctx context.Context, timestamp time.Time) error) error

ListSnapshots returns snapshots newest to oldest

func (*Manager) NewSession

func (s *Manager) NewSession(ctx context.Context) (*Session, error)

func (*Manager) OpenSnapshot

func (s *Manager) OpenSnapshot(ctx context.Context, timestamp time.Time) (*Snapshot, error)

func (*Manager) RevertTo

func (s *Manager) RevertTo(ctx context.Context, timestamp time.Time) (*Session, error)

type ReadSeekCloser

type ReadSeekCloser interface {
	io.Reader
	io.Seeker
	io.Closer
}

type Session

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

func (*Session) Close

func (s *Session) Close() error

func (*Session) Commit

func (s *Session) Commit(ctx context.Context) (err error)

func (*Session) Delete

func (s *Session) Delete(ctx context.Context, path string) (removed bool, err error)

func (*Session) DeleteAll

func (s *Session) DeleteAll(ctx context.Context, matcher func(string) bool) (removed int, err error)

func (*Session) Flush

func (s *Session) Flush(ctx context.Context) error

func (*Session) List

func (s *Session) List(ctx context.Context, prefix string, recursive bool,
	cb func(ctx context.Context, path string, prefix bool) error) error

func (*Session) PutFile

func (s *Session) PutFile(ctx context.Context, path string, creation, modified time.Time, mode uint32,
	data ReadSeekCloser) (state pathdb.PutState, err error)

PutFile causes the Session to take ownership of the data io.ReadCloser and will close it when the Session either uses the data or closes itself.

func (s *Session) PutSymlink(ctx context.Context, path string, creation, modified time.Time, mode uint32, target string) (
	state pathdb.PutState, err error)

func (*Session) Rename

func (s *Session) Rename(ctx context.Context, re *regexp.Regexp, replacement string) (renamed int, err error)

Rename renames paths using regexp.ReplaceAllString (replacement can have regexp expansions). See the docs for regexp.ReplaceAllString

type Snapshot

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

func (*Snapshot) Close

func (s *Snapshot) Close() error

func (*Snapshot) HasPrefix

func (s *Snapshot) HasPrefix(ctx context.Context, prefix string) (exists bool, err error)

func (*Snapshot) List

func (s *Snapshot) List(ctx context.Context, prefix string, recursive bool,
	cb func(ctx context.Context, entry *ListEntry) error) error

func (*Snapshot) Open

func (s *Snapshot) Open(ctx context.Context, path string) (*manifest.Metadata, *streams.Stream, error)

Open will return a nil stream if the filetype is a symlink or something

Jump to

Keyboard shortcuts

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