s3wrapper

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

package s3wrapper contains functions for downloading and uploading files to/from S3

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBucket

func CreateBucket(bucket string) error

CreateBucket creates an S3 bucket

func GetFile

func GetFile(bucket string, key string, dstFile string) error

GetFile downloads the file specified by s3://bucket/key and writes it to disk as dstFile

func PutFile

func PutFile(srcFile string, bucket string, key string) error

PutFile uploads srcFile to s3 as s3://bucket/key

func RemoveBucket

func RemoveBucket(bucket string) error

RemoveBucket deletes the S3 bucket

func RemoveFile

func RemoveFile(bucket string, key string) error

RemoveFile deletes from S3 the file specified by s3://bucket/key

Types

type S3FileData

type S3FileData struct {
	Name         string    // name of the S3 file
	Size         int64     // size of S3 file
	LastModified time.Time // last modified time
	Etag         string    // a unique identifier
}

S3FileData contains metadata used when invoking ListFiles(bucket)

func ListFiles

func ListFiles(bucket string) ([]S3FileData, error)

ListFiles lists files within an S3 bucket

Jump to

Keyboard shortcuts

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