Documentation
¶
Index ¶
- func GetBucketKey(s3Path string) (string, string, error)
- func GetObjectContent(ctx context.Context, bucketName, key string) ([]byte, error)
- func GetPresignedDownloadURL(ctx context.Context, bucketName, key string, expires time.Duration) (string, error)
- func GetPresignedURL(ctx context.Context, bucketName, key string, expires time.Duration, ...) (string, error)
- func GetS3Path(bucketName, key string) string
- func ListBuckets() ([]string, error)
- func PutObject(ctx context.Context, bucketName, key string, body io.Reader) error
- func PutObjectWithHeaders(ctx context.Context, bucketName, key string, body io.Reader, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBucketKey ¶
GetBucketKey extracts the bucket name and key from an S3 path
func GetObjectContent ¶
GetObjectContent fetches an object from S3 and returns its content as bytes
func GetPresignedDownloadURL ¶
func GetPresignedDownloadURL(ctx context.Context, bucketName, key string, expires time.Duration) (string, error)
GetPresignedDownloadURL generates a presigned GET URL for downloading an object. The signer only mints the URL; the actual read happens client-side under the caller's existing `s3:GetObject` permission, so no separate read path is required. The URL is scoped to this single object and valid for `expires`.
func GetPresignedURL ¶
func GetPresignedURL(ctx context.Context, bucketName, key string, expires time.Duration, overwrite bool) (string, error)
GetPresignedURL generates a presigned URL for the given operation
func ListBuckets ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.