bundle

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: 10 Imported by: 0

Documentation

Overview

Package bundle defines methods for bundling snapshots together so they can be imported and/or exported.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Export

func Export(ctx context.Context, s *storage.LocalFiles, path string, snapshots []*snapshot.Hash, exclude []*snapshot.Hash, metadata map[string]io.ReadCloser, recurseParents bool) (included []*snapshot.Hash, err error)

Export writes a bundle with the specified snapshots to the given writer.

If the returned error is nil, then the written bundle will include the specified snapshots, and their contents. For any snapshots of a directory, the bundle will also recursively include the snapshots for the children of that directory.

The `exclude` argument specifies a list of objects (by hash) that will not be included in the resulting bundle even if they otherwise would have been.

The `metadata` argument specifies an additional map of key/value pairs to include in the bundle in a separate subpath from the bundled objects.

func Import

func Import(ctx context.Context, s *storage.LocalFiles, path string, exclude []*snapshot.Hash) (included []*snapshot.Hash, err error)

Types

type ZipWriter

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

func NewZipWriter

func NewZipWriter(w io.Writer, exclude []*snapshot.Hash, metadata map[string]io.ReadCloser, recurseParents bool) (*ZipWriter, error)

func (*ZipWriter) AddFile

func (w *ZipWriter) AddFile(ctx context.Context, s *storage.LocalFiles, h *snapshot.Hash, f *snapshot.File) (err error)

func (*ZipWriter) AddObject

func (w *ZipWriter) AddObject(ctx context.Context, s *storage.LocalFiles, h *snapshot.Hash) error

func (*ZipWriter) Close

func (w *ZipWriter) Close() error

Jump to

Keyboard shortcuts

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