s3

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBucket

func CreateBucket(client *s3.S3, bucketName string) error

CreateBucket creates a bucket with the input `bucketName`.

func DestroyBucket

func DestroyBucket(client *s3.S3, bucketName string) error

DestroyBucket destroys a bucket with the input `bucketName`.

func DownloadBucketFile

func DownloadBucketFile(sess *session.Session, bucketName string, objectKey string, downloadFP string) (string, error)

DownloadBucketFile downloads a file found at the file path specified with the input objectKey to the input bucketName.

func EmptyBucket

func EmptyBucket(client *s3.S3, bucketName string) error

EmptyBucket deletes everything found in the input `bucketName`.

func GetBuckets

func GetBuckets(client *s3.S3) ([]*s3.Bucket, error)

GetBuckets returns all s3 buckets that the input client has access to.

func UploadBucketFile

func UploadBucketFile(sess *session.Session, bucketName string, uploadFP string) error

UploadBucketFile uploads a file found at the file path specified with (`uploadFP`) to the input `bucketName`.

Types

type Connection

type Connection struct {
	Client  *s3.S3
	Session *session.Session
	Params  Params
}

Connection contains all of the relevant information to maintain an S3 connection.

func CreateConnection

func CreateConnection() Connection

CreateConnection creates a connection with DynamoDB and returns it.

type Params

type Params struct {
	BucketName string
	Created    time.Time
	Modified   time.Time
}

Params provides parameter options for an S3 bucket.

Jump to

Keyboard shortcuts

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