Documentation ¶
Index ¶
- Constants
- func CopyObject(client s3iface.S3API, inputBucket, inputKey, outputBucket, outputKey string) error
- func DeleteObject(client s3iface.S3API, bucket, file string) error
- func DeleteObjects(client s3iface.S3API, bucket string, files []string) error
- func DownloadObject(client s3iface.S3API, bucket, src string) ([]byte, error)
- func ListBucket(client s3iface.S3API, bucket, prefix, lastKey string, maxKeys int64) ([]string, error)
- func ListFolders(client s3iface.S3API, bucket, prefix, lastKey string, maxKeys int64) ([]string, error)
- func ListNObjectsInBucket(client s3iface.S3API, bucket, prefix, lastKey, delimiter string, maxKeys int64) (objects []string, isTruncated bool, err error)
- func ObjectExists(client s3iface.S3API, bucket, file string) (bool, error)
- func RenameObject(client s3iface.S3API, bucket, inputKey, outputKey string) error
- func UploadObject(client s3iface.S3API, bucket, dst string, src []byte) error
Constants ¶
const CannotReadError = "cannot read remote object"
CannotReadError is used in the tests.
Variables ¶
This section is empty.
Functions ¶
func CopyObject ¶
CopyObject copies the `inputKey` in the inputBucket to `outputKey` in the outputBucket.
func DeleteObject ¶
DeleteObject delete the key in the specified bucket.
func DeleteObjects ¶ added in v1.23.5
DeleteObjects delete the keys in the specified bucket.
func DownloadObject ¶
DownloadObject downloads a file from an S3 bucket given the bucket and key. The response is in slice of byte format.
func ListBucket ¶
func ListBucket(client s3iface.S3API, bucket, prefix, lastKey string, maxKeys int64) ([]string, error)
ListBucket returns a slice of the files at an S3 bucket at a given prefix. It lists the objects using maxKeys in each iteration, but returns all of the objects, which may be higher than maxKeys.
func ListFolders ¶
func ListFolders(client s3iface.S3API, bucket, prefix, lastKey string, maxKeys int64) ([]string, error)
ListFolders returns the folders stored at `prefix` in the bucket `bucket`.
func ListNObjectsInBucket ¶
func ListNObjectsInBucket(client s3iface.S3API, bucket, prefix, lastKey, delimiter string, maxKeys int64) (objects []string, isTruncated bool, err error)
ListNObjectsInBucket returns a slice of the files at an S3 bucket at a given prefix. It starts listing the files from `lastKey` and returns up to `maxKeys`.
func ObjectExists ¶
ObjectExists returns a boolean of whether the key exists in the bucket.
func RenameObject ¶
RenameObject renames the `inputKey` in the bucket to `outputKey`.
Types ¶
This section is empty.