manager

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Archiver

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

Archiver is the struct able to create an archive

func NewArchiver

func NewArchiver(files []string, w walker.Walker, d downloader.Downloader, config Config) (*Archiver, error)

NewArchiver creates a new archiver able to create an archive containing the files in the list

func (*Archiver) CreateTar

func (a *Archiver) CreateTar(ctx context.Context, dst io.Writer) error

CreateTar creates a tar and write it into the dst Writer

func (*Archiver) CreateZip

func (a *Archiver) CreateZip(ctx context.Context, dst io.Writer) error

CreateZip creates a zip and write it into the dst Writer

type Config

type Config struct {
	MaxNumFiles int64
	MaxSize     int64
}

Config is the config for the Archiver

type ErrEmptyList

type ErrEmptyList struct{}

ErrEmptyList is the error returned when an empty list is passed when an archiver is created

func (ErrEmptyList) Error

func (ErrEmptyList) Error() string

Error returns the string error msg for ErrEmptyList

type ErrMaxFileCount

type ErrMaxFileCount struct{}

ErrMaxFileCount is the error returned when the max files count specified in the config has reached

func (ErrMaxFileCount) Error

func (ErrMaxFileCount) Error() string

Error returns the string error msg for ErrMaxFileCount

type ErrMaxSize

type ErrMaxSize struct{}

ErrMaxSize is the error returned when the max total files size specified in the config has reached

func (ErrMaxSize) Error

func (ErrMaxSize) Error() string

Error returns the string error msg for ErrMaxSize

Jump to

Keyboard shortcuts

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