s3

package
v1.20.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const RAIN_BUCKET_SSM_KEY = "rain-bucket"

Variables

View Source
var BucketKeyPrefix = ""

BucketKeyPrefix is set by the --s3-prefix param to deploy and pkg commands

View Source
var BucketName = ""

BucketName is set by the --s3-bucket param to deploy and pkg commands

View Source
var ExpectedBucketOwner = ""

ExpectedBucketOwner is set by the --s3-owner param to deploy and pkg commands

Functions

func BucketExists

func BucketExists(bucketName string) (bool, error)

BucketExists checks whether the named bucket exists

func BucketHasContents added in v1.4.0

func BucketHasContents(bucketName string) (bool, error)

BucketHasContents returns true if the bucket is not empty

func CreateBucket

func CreateBucket(bucketName string) error

CreateBucket creates a new S3 bucket

func DeleteObject added in v1.7.0

func DeleteObject(bucketName string, key string, version *string) error

DeleteObject deletes an object from a bucket

func EmptyBucket added in v1.16.0

func EmptyBucket(bucketName string) error

EmptyBucket deletes all versions of all objects in a bucket

func GetObject added in v1.7.0

func GetObject(bucketName string, key string) ([]byte, error)

GetObject gets an object by key from an S3 bucket

func GetUnzippedObjectSize added in v1.13.1

func GetUnzippedObjectSize(bucketName string, key string) (int64, error)

GetUnzippedObjectSize gets the uncompressed length in bytes of an object. Calling this on a large object will be slow!

func PutObject added in v1.7.0

func PutObject(bucketName string, key string, body []byte) error

PutObject puts an object into a bucket

func RainBucket

func RainBucket(forceCreation bool) string

RainBucket returns the name of the rain deployment bucket in the current region and asks the user if they wish it to be created if it does not exist unless forceCreation is true, then it will not ask. If a blank string is passed in, we look for a parameter store key named "rain-bucket". If that doesn't exist, we use "rain-artifacts-accountid-region". If a non-blank string is passed in, we create that bucket if it doesn't exist.

func Upload

func Upload(bucketName string, content []byte) (string, error)

Upload uploads an artifact to the bucket with a unique name

Types

type S3ObjectInfo added in v1.13.1

type S3ObjectInfo struct {
	SizeBytes int64
}

func HeadObject added in v1.13.1

func HeadObject(bucketName string, key string) (*S3ObjectInfo, error)

HeadObject gets information about an object without downloading it

Jump to

Keyboard shortcuts

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