util

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: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBucketSize

func CheckBucketSize(bucketContents *s3.ListObjectsOutput, expectedContentSize int) bool

CheckBucketSize returns true if the bucket size is the same as the expected bucket size; else false

func CheckPrefix

func CheckPrefix(key string, prefix string) bool

CheckPrefix checks if the prefix of a string matches the specified prefix. Returns true if it matches; else false

func CleanUpMultiPartUploads

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

CleanUpMultiPartUploads is a Helpful function to get rid of all abandoned multipart uploads

func ComputeMD5Sum

func ComputeMD5Sum(filePath string) ([]byte, error)

ComputeMD5Sum takes the full path of a file and returns the md5sum

func CreateBigFile

func CreateBigFile(pathToBigFile string, size int64) error

CreateBigFile writes a file to disk that consists of null characters

func CreateFile

func CreateFile(pathToFile string, contents []byte) error

CreateFile writes the provided byte array to a file on disk

func EmptyBucket

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

EmptyBucket simply deletes all the objects in the specified bucket

func FindKeyInBucket

func FindKeyInBucket(keyToFind string, bucketContents *s3.ListObjectsOutput) bool

FindKeyInBucket returns true if the specified key exists in the *s3.ListObjectOutput; otherwise false

func FindKeysInBucketByPrefix

func FindKeysInBucketByPrefix(prefix string, bucketContents *s3.ListObjectsOutput) []string

FindKeysInBucketByPrefix will return all the keys that match a prefix in the provided *s3.ListObjectsOutput

func GetKeyType

func GetKeyType(policy rpolicy.RotationPolicy, keyTime time.Time) string

GetKeyType returns the specified key type (_monthly, _weekly, _daily) for a particular time

func RetrieveSortedKeysByTime

func RetrieveSortedKeysByTime(svc *s3.S3, bucket string, prefix string) ([]s3client.BucketEntry, error)

RetrieveSortedKeysByTime is a helper function to get all sorted keys

Types

This section is empty.

Jump to

Keyboard shortcuts

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