s3util

package
v0.0.0-...-f43c413 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package s3util includes functions for interacting with AWS s3.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBucket

func CheckBucket(bucket string) error

func CheckKey

func CheckKey(prefix string) error

func CheckKeyPrefix

func CheckKeyPrefix(prefix string) error

func CheckPath

func CheckPath(path string) error

func Count

func Count(it *Iterator) (int, error)

Count iterates through an iterator and returns the total number of objects.

func Download

func Download(input *DownloadInput) error

func Upload

func Upload(input *UploadInput) error

Types

type BucketError

type BucketError struct {
	Value string
}

func (*BucketError) Error

func (e *BucketError) Error() string

type DownloadInput

type DownloadInput struct {
	Context    context.Context
	Downloader *s3manager.Downloader
	Bucket     string
	Key        string
	Path       string
	Parents    bool
}

type Iterator

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

func NewIterator

func NewIterator(input *NewIteratorInput) *Iterator

func (*Iterator) Error

func (it *Iterator) Error() error

func (*Iterator) Next

func (it *Iterator) Next() (*s3.Object, error)

func (*Iterator) Reset

func (it *Iterator) Reset(input *NewIteratorInput)

type KeyError

type KeyError struct {
	Value string
}

func (*KeyError) Error

func (e *KeyError) Error() string

type KeyPrefixError

type KeyPrefixError struct {
	Value string
}

func (*KeyPrefixError) Error

func (e *KeyPrefixError) Error() string

type NewIteratorInput

type NewIteratorInput struct {
	Client  *s3.S3
	Bucket  string
	Prefix  string
	MaxKeys int
}

type PathError

type PathError struct {
	Value string
}

func (*PathError) Error

func (e *PathError) Error() string

type UploadInput

type UploadInput struct {
	Context  context.Context
	Uploader *s3manager.Uploader
	Path     string
	Bucket   string
	Key      string
}

Jump to

Keyboard shortcuts

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