offline_blob

package
v0.0.0-...-bbf0bf7 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type S3Bucket

type S3Bucket struct {
	Bucket string
	ACL    string
}

S3Bucket holds the information of the bucket

type S3Client

type S3Client struct {
	Service *s3.S3
	Bucket  string
}

S3Client is the object that wraps around the official aws SDK

func NewS3Client

func NewS3Client(bucket *S3Bucket, sess *session.Session) *S3Client

NewS3Client is a wrapper object around the official aws s3 client

func (*S3Client) CreateS3Bucket

func (c *S3Client) CreateS3Bucket(bucket *S3Bucket) (bool, error)

CreateS3Bucket creates a bucket It returns false if the bucket exists, true otherwise

func (*S3Client) DeleteS3AllObjects

func (c *S3Client) DeleteS3AllObjects(bucket *S3Bucket) error

DeleteS3AllObjects all objects within a bucket (this is not the most efficient way)

func (*S3Client) DeleteS3Bucket

func (c *S3Client) DeleteS3Bucket(bucket *S3Bucket) (bool, error)

DeleteS3Bucket creates a bucket It returns false if the bucket exists, true otherwise

func (*S3Client) ExistsObject

func (c *S3Client) ExistsObject(key string) bool

ExistsObject test if the specified key exists in the bucket It returns true if the key exists, false otherwise

func (*S3Client) GetObject

func (c *S3Client) GetObject(key string) (*io.ReadCloser, error)

GetObject returns the specified object-key from the selected bucket

func (*S3Client) UploadS3File

func (c *S3Client) UploadS3File(fileDir string, bucket *S3Bucket) error

UploadS3File a file to S3

Jump to

Keyboard shortcuts

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