Documentation
¶
Index ¶
- type BucketMetrics
- type S3AO
- func (s S3AO) CopyObject(srcKey, dstKey string) error
- func (s S3AO) GetBucket() string
- func (s S3AO) GetBucketMetrics() (metrics BucketMetrics)
- func (s S3AO) GetClient() *s3.Client
- func (s S3AO) GetObject(contentSHA256 string, start int64, end int64) (io.ReadCloser, error)
- func (s S3AO) GetObjectKey(bin string, filename string) (key string)
- func (s S3AO) GetObjectURL(contentSHA256 string) string
- func (s S3AO) ListObjects() (objects []string, err error)
- func (s S3AO) ListObjectsWithPrefix(prefix string) ([]types.Object, error)
- func (s S3AO) PresignedGetObject(contentSHA256 string, filename string, mime string, clientIP string) (presignedURL *url.URL, err error)
- func (s S3AO) PutObject(bin string, filename string, data io.Reader, size int64) (err error)
- func (s S3AO) PutObjectByHash(contentSHA256 string, data io.Reader, size int64) (err error)
- func (s S3AO) RemoveBucket() error
- func (s S3AO) RemoveKey(key string) error
- func (s S3AO) RemoveObject(bin string, filename string) error
- func (s S3AO) RemoveObjectByHash(contentSHA256 string) error
- func (s S3AO) SetTrace(trace bool)
- func (s S3AO) StatObject(key string) (*s3.HeadObjectOutput, error)
- func (s S3AO) Status() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BucketMetrics ¶
type S3AO ¶
type S3AO struct {
// contains filtered or unexported fields
}
func Init ¶
func Init(endpoint, bucket, region, accessKey, secretKey string, secure bool, presignExpiry, timeout, transferTimeout time.Duration) (S3AO, error)
Initialize S3AO
func (S3AO) CopyObject ¶
CopyObject copies an object from one key to another within the same bucket
func (S3AO) GetBucketMetrics ¶
func (s S3AO) GetBucketMetrics() (metrics BucketMetrics)
func (S3AO) GetObjectURL ¶
GetObjectURL returns the full S3 URL for a content SHA256
func (S3AO) ListObjects ¶
func (S3AO) ListObjectsWithPrefix ¶
ListObjectsWithPrefix lists objects with a given prefix
func (S3AO) PresignedGetObject ¶
func (s S3AO) PresignedGetObject(contentSHA256 string, filename string, mime string, clientIP string) (presignedURL *url.URL, err error)
PresignedGetObject generates a presigned URL for downloading an object. If clientIP is provided, the URL will require the X-Forwarded-For header to be set to that value when making the request (the header is included in the signature). This only works with objects that are not encrypted.
func (S3AO) PutObjectByHash ¶
PutObjectByHash uploads an object using content-addressable storage (SHA256 as key)
func (S3AO) RemoveBucket ¶
func (S3AO) RemoveObjectByHash ¶
RemoveObjectByHash removes an object using content-addressable storage (SHA256 as key)
func (S3AO) StatObject ¶
func (s S3AO) StatObject(key string) (*s3.HeadObjectOutput, error)
StatObject checks if an object exists and returns its metadata