Documentation ¶
Overview ¶
----------------------------------------------------------------*\
- @author Ly Nam <lyquocnam@live.com>
- @copyright 2019 Viet Tran <viettranx@gmail.com>
- @license Apache-2.0
- @description Plugin to upload image to AWS S3 *----------------------------------------------------------------
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrS3ApiKeyMissing = sdkcm.CustomError("ErrS3ApiKeyMissing", "AWS S3 API key is missing") ErrS3ApiSecretKeyMissing = sdkcm.CustomError("ErrS3ApiSecretKeyMissing", "AWS S3 API secret key is missing") ErrS3RegionMissing = sdkcm.CustomError("ErrS3RegionMissing", "AWS S3 region is missing") ErrS3BucketMissing = sdkcm.CustomError("ErrS3ApiKeyMissing", "AWS S3 bucket is missing") )
Functions ¶
Types ¶
type S3 ¶
type S3 interface { UploadFileData(ctx context.Context, fileData []byte, cloudFolder string) (string, error) // Upload image to AWS S3 and response URL Upload(ctx context.Context, fileName string, cloudFolder string) (string, error) // Get image link from uploaded with imageKey and duration GetImageWithExpireLink(ctx context.Context, imageKey string, duration time.Duration) (string, error) // Delete image with imageKey and duration DeleteImages(ctx context.Context, fileKeys []string) error // Delete any object DeleteObject(ctx context.Context, key string) error }
Click to show internal directories.
Click to hide internal directories.