s3

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type S3

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

func (*S3) Attributes

func (s *S3) Attributes(bucket, prefix string) (*system.Attrs, error)

GetObjectAttributes gets the attributes of an object

func (*S3) BatchAttributes

func (s *S3) BatchAttributes(bucket, prefix string, recursive bool) ([]*system.Attrs, error)

GetObjectsAttributes gets the attributes of all the objects under a prefix

func (*S3) Cat

func (s *S3) Cat(bucket, prefix string) ([]byte, error)

OutputObject outputs an object

func (*S3) Copy

func (s *S3) Copy(srcBucket, srcPrefix, dstBucket, dstPrefix string) error

CopyObject copies an object

func (*S3) Delete

func (s *S3) Delete(bucket, prefix string) error

DeleteObject deletes an object

func (*S3) DeleteObject

func (s *S3) DeleteObject(bucket, prefix string) error

func (*S3) DiskUsage

func (s *S3) DiskUsage(bucket, prefix string, recursive bool) ([]system.DiskUsage, error)

GetDiskUsageObjects gets disk usage of objects under a prefix

func (*S3) Download

func (s *S3) Download(
	bucket, prefix, dstFile string,
	forceChecksum bool,
	ctx system.RunContext,
) error

DownloadObjectWithWorkerPool downloads a specific byte range of an object to a file.

func (*S3) GetObjectReader

func (s *S3) GetObjectReader(bucket, prefix string) (io.ReadCloser, error)

func (*S3) Init added in v1.0.6

func (s *S3) Init(buckets ...string) error

func (*S3) IsDirectory

func (s *S3) IsDirectory(bucket, prefix string) (bool, error)

IsDirectory checks if is a directory

func (*S3) IsObject

func (s *S3) IsObject(bucket, prefix string) (bool, error)

IsObject checks if is an object case 1: gs://abc/def -> gs://abc/def/ : false case 2: gs://abc/de -> gs://abc/def/ : false case 3: gs://abc/def/ -> gs://abc/def/ : false case 4: gs://abc/def -> gs://abc/def : true

func (*S3) List

func (s *S3) List(bucket, prefix string, recursive bool) ([]*system.FileObject, error)

List objects under a prefix

func (*S3) Move

func (s *S3) Move(srcBucket, srcPrefix, dstBucket, dstPrefix string) error

MoveObject moves an object

func (*S3) MustEqualCRC32C

func (s *S3) MustEqualCRC32C(flag bool, localPath, bucket, object string) error

MustEqualCRC32C compare CRC32C values if flag is set - compare a local file with an object from gcp - exit process if values are different

func (*S3) PutObject

func (s *S3) PutObject(bucket, prefix string, from io.Reader) error

func (*S3) S3Attrs

func (s *S3) S3Attrs(bucket, prefix string) (*S3Attributes, error)

func (*S3) Scheme

func (s *S3) Scheme() string

func (*S3) Upload

func (s *S3) Upload(srcFile, bucket, prefix string, ctx system.RunContext) error

UploadObject uploads an object from a file

type S3Attributes

type S3Attributes struct {
	S3Attrs *s3.GetObjectAttributesOutput
	Bucket  string
	Prefix  string
}

Jump to

Keyboard shortcuts

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