file

package
v0.0.0-...-36cd75f Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetS3Secrets

func GetS3Secrets(vault_key string) (string, string)

GetS3Secrets returns 2 values: (S3_ACCESS_KEY, S3_SECRET_KEY)

func GetS3SecretsEnv

func GetS3SecretsEnv() (string, string)

func KeyExists

func KeyExists(key string, s3Client *s3.S3) bool

func ReadObject

func ReadObject(key string, s3Client *s3.S3) (*s3.GetObjectOutput, error)

func ReadObject(key string, s3Client *s3.S3) ([]byte, error) {

func S3FileReader

func S3FileReader(key string, s3Client *s3.S3) (io.ReadCloser, error)

s3FileReader converts an S3Path into an io.ReadCloser

func Upload

func Upload(fh *multipart.FileHeader, s3Client *s3.S3) (string, error)

Upload puts a file into my S3 storage

fh *multipart.FileHeader https://godoc.org/mime/multipart#FileHeader

Returns a key of a newly created object.

  • error is not nil when failed to execute s3Client.PutObject()
  • key is empty is an error happened

func WriteToS3

func WriteToS3(src io.ReadSeeker, s3Client *s3.S3) (string, error)

writeToS3 uploads the given data to S3 Returns: (object key, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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