s3utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Copier

type Copier struct {
	Options    CopierOptions
	Client     *s3.Client
	Downloader *manager.Downloader
	Uploader   *manager.Uploader
}

Copier holds state for copying

func NewCopier

func NewCopier(opts CopierOptions, client *s3.Client) Copier

NewCopier creates a new Copier

func (*Copier) Copy

func (c *Copier) Copy(copyJob CopyJob) error

Copy executes a copy job

func (*Copier) CopyAll

func (c *Copier) CopyAll(copyJobs []CopyJob) error

CopyAll executes a slice of copy Jobs

type CopierOptions

type CopierOptions struct {
	BufferSize  int
	Checksum    bool
	Concurrency int
	DisableSSL  bool
	MaxRetries  int
	PartSize    int64
	Verbose     bool
}

CopierOptions are options for a copier object

type CopyJob

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

CopyJob defines a file/object copy

func GetCopyJobs

func GetCopyJobs(src Path, dest Path, recursive bool) ([]CopyJob, error)

GetCopyJobs gets the jobs required to copy between two paths

func NewCopyJob

func NewCopyJob(source Path, destination Path) CopyJob

NewCopyJob creates a new CopyJob

type Path

type Path interface {
	IsDir() (bool, error)
	Exists() (bool, error)
	IsS3() bool
	IsLocal() bool
	DirOrFolder() string
	FileOrObject() string
	ListPathsWithPrefix() ([]Path, error)
	Join(...string) Path
	Base() string
	WithoutBucket() string
	Bucket() (string, error)
	String() string
}

Path is an interface of functions to apply transparently to s3 or local paths

func NewPath

func NewPath(client *s3.Client, raw string) (Path, error)

NewPath creates a Path from a raw string

Jump to

Keyboard shortcuts

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