Documentation ¶
Overview ¶
Package s3uploader provides a simple wrapper around AWS S3 SDK to upload files to S3 bucket.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { BucketName string AccessKeyID string AccessKeySecret string Region string PresignDuration time.Duration AccountID string }
Config is a struct that contains the configuration for the S3 uploader
type Uploader ¶
type Uploader struct {
// contains filtered or unexported fields
}
Uploader is a struct that contains the AWS S3 client and uploader
func NewUploader ¶
func (*Uploader) GetObjectPresignedUrl ¶
GetObjectPresignedUrl generates a presigned URL for the object in the S3 bucket The key is the path to the file in the bucket It returns the presigned URL The URL is in the format based on this reference: https://docs.aws.amazon.com/AmazonS3/latest/API/s3_example_s3_Scenario_PresignedUrl_section.html
func (*Uploader) GetObjectPublicUrls ¶
GetObjectPublicUrls generates a public URL for the object in the S3 bucket The key is the path to the file in the bucket It returns the public URL The URL is in the format based on this reference: https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html#virtual-hosted-style-access