ziparchiver

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open() *zipArchive

func Restore

func Restore(ctx context.Context, assets iter.Seq[asset.ArchivedAsset], logger zerolog.Logger, opts ...RestoreOption) error

func StoreAssets

func StoreAssets(
	ctx context.Context,
	sourcePath string,
	dest ArchiveDescriptor,
	assets iter.Seq[asset.Asset],
	logger zerolog.Logger,
	opts ...StoreOption,
) error

Types

type ArchiveDescriptor

type ArchiveDescriptor struct {
	Dir    string // Directory path.
	Prefix string // Can be empty.
}

type OnlyNewAssets

type OnlyNewAssets interface {
	FindMissingAssets(ctx context.Context, from iter.Seq[asset.Asset]) (iter.Seq[asset.Asset], error)
}

type RegisterArchivedAssets

type RegisterArchivedAssets interface {
	Register(ctx context.Context, assets iter.Seq[asset.ArchivedAsset]) error
}

type RestoreOption

type RestoreOption func(o *restoreOptions)

func WithRestoreDryRun

func WithRestoreDryRun(dryRun bool) RestoreOption

type StoreOption

type StoreOption func(o *storeOptions)

func WithDryRun

func WithDryRun(dryRun bool) StoreOption

func WithIncludeLargeFiles

func WithIncludeLargeFiles(include bool) StoreOption

If true, files larger than maxFileBytes will be stored.

func WithMaxFileBytes

func WithMaxFileBytes(maxFileBytes int64) StoreOption

The maximum number of bytes (uncompressed) to store in a single archive.

func WithOnlyNewAssets

func WithOnlyNewAssets(only OnlyNewAssets) StoreOption

func WithRegisterArchivedAssets

func WithRegisterArchivedAssets(register RegisterArchivedAssets) StoreOption

Register the assets stored in the archive.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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