aws

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2023 License: BSD-2-Clause Imports: 14 Imported by: 0

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(400, nil, "ErrS3ApiKeyMissing", "AWS S3 API key is missing")
	ErrS3ApiSecretKeyMissing = sdkcm.CustomError(400, nil, "ErrS3ApiSecretKeyMissing", "AWS S3 API secret key is missing")
	ErrS3RegionMissing       = sdkcm.CustomError(400, nil, "ErrS3RegionMissing", "AWS S3 region is missing")
	ErrS3BucketMissing       = sdkcm.CustomError(400, nil, "ErrS3ApiKeyMissing", "AWS S3 bucket is missing")
)

Functions

func New

func New(prefix ...string) *s3

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL