s3

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: Apache-2.0 Imports: 10 Imported by: 11

Documentation

Overview

s3 tools

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckUserLock

func CheckUserLock(s3c aws.S3API, bucket *string, lock_path *string) error

func Delete

func Delete(s3c aws.S3API, bucket *string, path *string) error

Delete deletes contents from S3

func Get

func Get(s3c aws.S3API, bucket *string, path *string) (*[]byte, error)

Get downloads content from S3

func GetBucketTags

func GetBucketTags(s3c aws.S3API, bucket *string) (map[string]string, error)

GetBucketTags returns the tags on a bucket

func GetObject

func GetObject(s3c aws.S3API, bucket *string, path *string) (*s3.GetObjectOutput, *[]byte, error)

func GetSHA256

func GetSHA256(s3c aws.S3API, bucket *string, path *string) (string, error)

GetSHA256 returns a hex string of the SHA256 of the value of a key in S3

func GetStr

func GetStr(s3c aws.S3API, bucket *string, path *string) (*string, error)

func GetStruct

func GetStruct(s3c aws.S3API, bucket *string, path *string, str interface{}) error

GetStruct returns a Struct from S3

func GrabLock

func GrabLock(s3c aws.S3API, bucket *string, lock_path *string, uuid string) (bool, error)

GrabLock creates a lock file in S3 with a UUID it returns a grabbed bool, and error if the Lock already exists and UUID is equal to the existing lock it will returns true, otherwise false if the Lock doesn't exist it will create the file and return true

func Put

func Put(s3c aws.S3API, bucket *string, path *string, content *[]byte) error

Put uploads content to s3

func PutFile

func PutFile(s3c aws.S3API, file_path *string, bucket *string, s3_file_path *string) error

PutFile uploads a file to S3

func PutSecure

func PutSecure(s3c aws.S3API, bucket *string, path *string, content *string, kmsKeyId *string) error

func PutSecureFile

func PutSecureFile(s3c aws.S3API, file_path *string, bucket *string, s3_file_path *string, kmsKeyId *string) error

func PutStr

func PutStr(s3c aws.S3API, bucket *string, path *string, content *string) error

func PutStruct

func PutStruct(s3c aws.S3API, bucket *string, path *string, str interface{}) error

PutStruct Uploads a Struct to S3

func PutWithCacheControl

func PutWithCacheControl(s3c aws.S3API, bucket *string, path *string, content *[]byte, cacheControl *string) error

func PutWithType

func PutWithType(s3c aws.S3API, bucket *string, path *string, content *[]byte, contentType *string) error

func PutWithTypeAndCacheControl

func PutWithTypeAndCacheControl(s3c aws.S3API, bucket *string, path *string, content *[]byte, contentType *string, cacheControl *string) error

func ReleaseLock

func ReleaseLock(s3c aws.S3API, bucket *string, lock_path *string, uuid string) error

ReleaseLock removes the lock file for UUID If the lock file exists and is not the same UUID it returns an error

Types

type Lock

type Lock struct {
	UUID string `json:"uuid,omitempty"`
}

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type UserLock

type UserLock struct {
	User       string `json:"user,omitempty"`
	LockReason string `json:"lock_reason", omitempty"`
}

Jump to

Keyboard shortcuts

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