Documentation
¶
Index ¶
- func DownloadFile(ctx context.Context, api GetObjectAPI, bucketName string, objectKey string) ([]byte, error)
- func DownloadFileStream(ctx context.Context, api GetObjectAPI, bucketName string, objectKey string) (io.ReadCloser, error)
- func DownloadLargeFile(ctx context.Context, api GetObjectAPI, bucketName string, objectKey string) ([]byte, error)
- func GeneratePresignedURL(ctx context.Context, api PresignObject, bucketName string, objectKey string, ...) (string, error)
- func NewClient(useTracing bool) *s3.Client
- type GetObjectAPI
- type ListObjectsV2API
- type PresignObject
- type S3File
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadFile ¶ added in v0.2.2
func DownloadFile(ctx context.Context, api GetObjectAPI, bucketName string, objectKey string) ([]byte, error)
DownloadFile downloads file from S3 and returns it as a byte slice
func DownloadFileStream ¶ added in v1.0.1
func DownloadFileStream(ctx context.Context, api GetObjectAPI, bucketName string, objectKey string) (io.ReadCloser, error)
DownloadFileStream downloads file from S3 and returns the io.ReadCloser. This must be closed by the callee function!
func DownloadLargeFile ¶ added in v0.2.2
func DownloadLargeFile(ctx context.Context, api GetObjectAPI, bucketName string, objectKey string) ([]byte, error)
DownloadFileLarge downloads file from S3 using download manager and returns it as a byte slice
func GeneratePresignedURL ¶ added in v1.1.0
Types ¶
type GetObjectAPI ¶ added in v0.2.2
type GetObjectAPI interface {
GetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error)
}
type ListObjectsV2API ¶
type ListObjectsV2API interface { ListObjectsV2(ctx context.Context, params *s3.ListObjectsV2Input, optFns ...func(*s3.Options)) (*s3.ListObjectsV2Output, error) }
type PresignObject ¶ added in v1.2.0
type PresignObject interface {
PresignGetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.PresignOptions)) (*v4.PresignedHTTPRequest, error)
}
Click to show internal directories.
Click to hide internal directories.