s3client

package
v0.0.0-...-8779331 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2017 License: GPL-3.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbortAllMultiPartUploads

func AbortAllMultiPartUploads(svc *s3.S3, bucket string, key string, uploadId string) error

AbortAllMultiPartUploads aborts all current multipart uploads in the S3 bucket

func CreateS3Client

func CreateS3Client(credFile string, profile string, region string) (*s3.S3, error)

CreateS3Client creates an S3 client using environment variables if present; else AWS creds file 2. Use the specified credential file

func DeleteKey

func DeleteKey(svc *s3.S3, bucket string, key string) (string, error)

DeleteKey simply deletes an S3 object given a bucket and key

func GetAllMultiPartUploads

func GetAllMultiPartUploads(svc *s3.S3, bucket string) (map[string]string, error)

GetAllMultiPartUploads returns all of the multipart uploads that currently exist in the S3 bucket

func GetBucketContents

func GetBucketContents(svc *s3.S3, bucket string) (*s3.ListObjectsOutput, error)

GetBucketContents returns the entire contents of the specified bucket

func GetCountMultiPartsById

func GetCountMultiPartsById(svc *s3.S3, bucket string, key string, uploadId string) (int64, error)

GetCountMultiPartsById returns the total number of multiupload parts That exist in a S3 bucket given a key and and UploadId

func GetKeysByPrefix

func GetKeysByPrefix(svc *s3.S3, bucket string, prefix string) (map[string]time.Time, error)

GetKeysByPrefix returns a map of keys in the bucket along with the LastModified attribute The map consists of Map[AWS Bucket Key] -> LastModifiedTime

func GetMultiPartUploadIDByKey

func GetMultiPartUploadIDByKey(svc *s3.S3, bucket string, key string) (string, error)

GetMultiPartUploadIDByKey finds the UploadID of the specified multi part upload by key if it exists

Types

type BucketEntry

type BucketEntry struct {
	Key          string
	ModifiedTime time.Time
}

BucketEntry represents an object which exists in S3

func SortKeysByTime

func SortKeysByTime(keys map[string]time.Time) []BucketEntry

SortKeysByTime sorts the bucket keys by the last modified time and Returns a bucket entry array with the newest values first

Jump to

Keyboard shortcuts

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