Documentation
¶
Index ¶
- type BucketMetrics
- type Config
- 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) SetMetrics(m S3MetricsObserver)
- func (s S3AO) StatObject(key string) (*s3.HeadObjectOutput, error)
- func (s S3AO) Status() bool
- type S3MetricsObserver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BucketMetrics ¶
type Config ¶ added in v0.0.3
type Config struct {
Endpoint string
Bucket string
Region string
AccessKey string
SecretKey string
Secure bool
PresignExpiry time.Duration
Timeout time.Duration
TransferTimeout time.Duration
MultipartPartSize int64
MultipartConcurrency int
}
Config holds all parameters needed to initialize an S3 connection.
type S3AO ¶
type S3AO struct {
// contains filtered or unexported fields
}
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) SetMetrics ¶ added in v0.0.3
func (s *S3AO) SetMetrics(m S3MetricsObserver)
SetMetrics sets the metrics observer for S3 operations.
func (S3AO) StatObject ¶
func (s S3AO) StatObject(key string) (*s3.HeadObjectOutput, error)
StatObject checks if an object exists and returns its metadata