Documentation
¶
Index ¶
- Constants
- type CustomReader
- type CustomWriter
- type S3ctx
- func (s *S3ctx) CompleteUploadedParts(bname, bkey, uploadID string, parts []string) error
- func (s *S3ctx) CreateBucket(bname string) error
- func (s *S3ctx) DeleteBucket(bname string) error
- func (s *S3ctx) DeleteObject(bname, bkey string) error
- func (s *S3ctx) DownloadFile(fname, bname, bkey string, objMaxSize int64, doneParts types.DownloadedParts, ...) (types.DownloadedParts, error)
- func (s *S3ctx) DownloadFileByChunks(fname, bname, bkey string) (io.ReadCloser, int64, error)
- func (s *S3ctx) GetObjectMD5(bname, bkey string) (string, error)
- func (s *S3ctx) GetObjectMetaData(bname, bkey string) (int64, string, error)
- func (s *S3ctx) GetObjectSize(bname, bkey string) (int64, error)
- func (s *S3ctx) GetObjectURL(bname, bkey string) (string, error)
- func (s *S3ctx) GetSignedURL(bname, bkey string, duration time.Duration) (string, error)
- func (s *S3ctx) IsBucketAvailable(bname string) (bool, error)
- func (s *S3ctx) ListImages(bname string, prgNotify types.StatsNotifChan) ([]string, error)
- func (s *S3ctx) UploadFile(fname, bname, bkey string, compression bool, prgNotify types.StatsNotifChan) (string, error)
- func (s *S3ctx) UploadPart(bname, bkey string, chunk []byte, partNumber int64, uploadID string) (string, string, error)
- func (s *S3ctx) WaitUntilBucketExists(bname string) bool
- func (s *S3ctx) WithContext(ctx context.Context) *S3ctx
- func (s *S3ctx) WithLogger(logger types.Logger) *S3ctx
Constants ¶
const ( // S3Concurrency parallels parts download/upload limit S3Concurrency = 5 // S3PartSize size of part to download/upload S3PartSize = 5 * 1024 * 1024 // S3PartLeaveError leaves parts to manual resolve errors on uploads S3PartLeaveError = true )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomReader ¶
type CustomReader struct {
// contains filtered or unexported fields
}
CustomReader contains the details of Chunks being downloaded
type CustomWriter ¶
type CustomWriter struct {
// contains filtered or unexported fields
}
type S3ctx ¶
type S3ctx struct {
// contains filtered or unexported fields
}
func NewAwsCtx ¶
func NewAwsCtx(id, secret, region string, useIPv6 bool, endpointOverride string, hctx *http.Client) (*S3ctx, error)
NewAwsCtx initializes AWS S3 context using SDK v2
func (*S3ctx) CompleteUploadedParts ¶
CompleteUploadedParts is used to complete the multiple uploaded parts
func (*S3ctx) CreateBucket ¶
CreateBucket creates a new S3 bucket
func (*S3ctx) DeleteBucket ¶
DeleteBucket deletes an S3 bucket
func (*S3ctx) DeleteObject ¶
DeleteObject removes an object from a bucket
func (*S3ctx) DownloadFile ¶
func (s *S3ctx) DownloadFile(fname, bname, bkey string, objMaxSize int64, doneParts types.DownloadedParts, prgNotify types.StatsNotifChan) (types.DownloadedParts, error)
func (*S3ctx) DownloadFileByChunks ¶
DownloadFileByChunks downloads the file from s3 chunk by chunk and passes it to the caller
func (*S3ctx) GetObjectMD5 ¶
GetObjectMD5 retrieves the ETag (often MD5) of an object
func (*S3ctx) GetObjectMetaData ¶
func (*S3ctx) GetObjectSize ¶
GetObjectSize retrieves the size (ContentLength) of an object
func (*S3ctx) GetObjectURL ¶
GetObjectURL generates a pre-signed GET URL valid for 1 minute
func (*S3ctx) GetSignedURL ¶
GetSignedURL is used to generate the URI which can be used to access the resource until the URI expries
func (*S3ctx) IsBucketAvailable ¶
IsBucketAvailable checks if a bucket exists in the account
func (*S3ctx) ListImages ¶
func (*S3ctx) UploadFile ¶
func (*S3ctx) UploadPart ¶
func (s *S3ctx) UploadPart(bname, bkey string, chunk []byte, partNumber int64, uploadID string) (string, string, error)
UploadPart is used to upload the given chunk of data into the Multipart file
func (*S3ctx) WaitUntilBucketExists ¶
WaitUntilBucketExists waits until the bucket exists or times out
func (*S3ctx) WithContext ¶
WithContext sets a custom context (e.g., for cancellation)