helpers

package
v0.0.0-...-3ba18f5 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Creds = credentials.NewStaticCredentials(viper.GetString("s3main.access_key"), viper.GetString("s3main.access_secret"), "")

Functions

func AbortMultiPartUpload

func AbortMultiPartUpload(svc *s3.S3, bucket string, key string, uploadid string) (*s3.AbortMultipartUploadOutput, error)

func AbortMultiPartUploadInvalid

func AbortMultiPartUploadInvalid(svc *s3.S3, bucket string, key string, uploadid string) (*s3.AbortMultipartUploadOutput, error)

func AddHeaders

func AddHeaders(conditions map[string]string) request.Option

func CompleteMultiUpload

func CompleteMultiUpload(svc *s3.S3, bucket string, key string, partNum int64, uploadid string, etag string) (*s3.CompleteMultipartUploadOutput, error)

func Contains

func Contains(slice []string, item string) bool

func CopyObject

func CopyObject(svc *s3.S3, other string, source string, item string) error

func CreateBucket

func CreateBucket(svc *s3.S3, bucket string) error

func CreateBucketWithHeader

func CreateBucketWithHeader(svc *s3.S3, bucket string, headers map[string]string) error

func CreateObjects

func CreateObjects(svc *s3.S3, bucket string, objects map[string]string) error

func DeleteBucket

func DeleteBucket(svc *s3.S3, bucket string) error

func DeleteObject

func DeleteObject(svc *s3.S3, bucket string, key string) error

func DeleteObjects

func DeleteObjects(svc *s3.S3, bucket string) error

func DeletePrefixedBuckets

func DeletePrefixedBuckets(svc *s3.S3)

func EncryptionSSECustomerWrite

func EncryptionSSECustomerWrite(svc *s3.S3, filesize int) (string, string, error)

func GeneratePresignedUrlGetObject

func GeneratePresignedUrlGetObject(svc *s3.S3, bucket string, key string) (string, error)

func GetBucketName

func GetBucketName() string

func GetConn

func GetConn() *s3.S3

func GetKeys

func GetKeys(svc *s3.S3, bucket string) (*s3.ListObjectsOutput, []string, error)

func GetKeysWithMarker

func GetKeysWithMarker(svc *s3.S3, bucket string, marker string) (*s3.ListObjectsOutput, []string, error)

func GetKeysWithMaxKeys

func GetKeysWithMaxKeys(svc *s3.S3, bucket string, maxkeys int64) (*s3.ListObjectsOutput, []string, error)

func GetKeysWithMaxKeysAndMarker

func GetKeysWithMaxKeysAndMarker(svc *s3.S3, bucket string, maxkeys int64, marker string) ([]string, error)

func GetLifecycle

func GetLifecycle(svc *s3.S3, bucket string) (*s3.GetBucketLifecycleConfigurationOutput, error)

func GetObj

func GetObj(svc *s3.S3, bucket string, key string) (*s3.GetObjectOutput, error)

func GetObject

func GetObject(svc *s3.S3, bucket string, key string) (string, error)

func GetObjectWithIfMatch

func GetObjectWithIfMatch(svc *s3.S3, bucket string, key string, condition string) (string, error)

func GetObjectWithIfModifiedSince

func GetObjectWithIfModifiedSince(svc *s3.S3, bucket string, key string, time time.Time) (string, error)

func GetObjectWithIfNoneMatch

func GetObjectWithIfNoneMatch(svc *s3.S3, bucket string, key string, condition string) (string, error)

func GetObjectWithIfUnModifiedSince

func GetObjectWithIfUnModifiedSince(svc *s3.S3, bucket string, key string, time time.Time) (string, error)

func GetObjectWithRange

func GetObjectWithRange(svc *s3.S3, bucket string, key string, range_value string) (*s3.GetObjectOutput, string, error)

func GetObjects

func GetObjects(svc *s3.S3, bucket string) (*s3.ListObjectsOutput, error)

func GetPrefix

func GetPrefix() string

func GetSetMetadata

func GetSetMetadata(metadata map[string]*string) map[string]*string

func InitiateMultipartUpload

func InitiateMultipartUpload(svc *s3.S3, bucket string, key string) (*s3.CreateMultipartUploadOutput, error)

func ListBuckets

func ListBuckets(svc *s3.S3) ([]string, error)

func ListObjects

func ListObjects(svc *s3.S3, bucket string) ([]*s3.Object, error)

func ListObjectsWithDelimeterAndPrefix

func ListObjectsWithDelimeterAndPrefix(svc *s3.S3, bucket string, prefix string, delimiter string) (*s3.ListObjectsOutput, []string, []string, error)

func ListObjectsWithDelimiter

func ListObjectsWithDelimiter(svc *s3.S3, bucket string, delimiter string) (*s3.ListObjectsOutput, []string, []string, error)

func ListObjectsWithPrefix

func ListObjectsWithPrefix(svc *s3.S3, bucket string, prefix string) (*s3.ListObjectsOutput, []string, []string, error)

func Listparts

func Listparts(svc *s3.S3, bucket string, key string, uploadid string) (*s3.ListPartsOutput, error)

func LoadConfig

func LoadConfig() error

func PutObjectToBucket

func PutObjectToBucket(svc *s3.S3, bucket string, key string, content string) error

func PutObjectWithIfMatch

func PutObjectWithIfMatch(svc *s3.S3, bucket string, key string, content string, tag string) error

func PutObjectWithIfNoneMatch

func PutObjectWithIfNoneMatch(svc *s3.S3, bucket string, key string, content string, tag string) error

func ReadSSECEcrypted

func ReadSSECEcrypted(svc *s3.S3, bucket string, key string, sse []string) (string, error)

func SSEKMSCustomerWrite

func SSEKMSCustomerWrite(svc *s3.S3, filesize int) (string, string, error)

func SSEKMSkeyIdCustomerWrite

func SSEKMSkeyIdCustomerWrite(svc *s3.S3, filesize int) (string, string, error)

func SetACL

func SetACL(svc *s3.S3, bucket string, acl string) (*s3.PutBucketAclOutput, error)

func SetLifecycle

func SetLifecycle(svc *s3.S3, bucket, id, status, md5 string) (*s3.PutBucketLifecycleConfigurationOutput, error)

func SetupBucketWithHeader

func SetupBucketWithHeader(svc *s3.S3, bucket string, headers map[string]string) error

func SetupObjectWithHeader

func SetupObjectWithHeader(svc *s3.S3, bucket string, key string, content string, headers map[string]string) error

func SetupRawRequest

func SetupRawRequest(proto, method, url, body string) (*http.Request, io.ReadSeeker)

func SetupRequest

func SetupRequest(serviceName, region, body string) (*http.Request, io.ReadSeeker)

func SetupSigner

func SetupSigner(creds *credentials.Credentials) v4.Signer

func String

func String(length int) string

func StringWithCharset

func StringWithCharset(length int, charset string) string

func UploadCopyPart

func UploadCopyPart(svc *s3.S3, bucket string, key string, source string, uploadid string, partnumber int64) (*s3.UploadPartCopyOutput, error)

func Uploadpart

func Uploadpart(svc *s3.S3, bucket string, key string, uploadid string, content string, partNum int64) (*s3.UploadPartOutput, error)

func WithIfMatch

func WithIfMatch(conditions ...string) request.Option

func WithIfNoneMatch

func WithIfNoneMatch(conditions ...string) request.Option

func WriteSSECEcrypted

func WriteSSECEcrypted(svc *s3.S3, bucket string, key string, content string, sse []string) error

func WriteSSEKMS

func WriteSSEKMS(svc *s3.S3, bucket string, key string, content string, sse string) error

func WriteSSEKMSkeyId

func WriteSSEKMSkeyId(svc *s3.S3, bucket string, key string, content string, sse string, kmskeyid string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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