aws_s3

package
v0.0.0-...-6f9dc6e Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultClientName = "default-s3-client"

Variables

This section is empty.

Functions

func InitService

func InitService(clientID, sk, token, region, point string) error

InitService 初始化客户端

func IsNotFoundErr

func IsNotFoundErr(err error) bool

IsNotFoundErr 判断资源是否不存在

Types

type Service

type Service struct {
	Client   *s3.S3
	EndPoint string
	Region   string
}

func GetS3Client

func GetS3Client(clientName string) (*Service, error)

GetS3Client 获取客户端

func (*Service) GetObj

func (s *Service) GetObj(key, bucket string) ([]byte, error)

GetObj 获取对象

func (*Service) PutFile

func (s *Service) PutFile(key, bucket, fileName string) error

PutFile 上传文件

func (*Service) PutObj

func (s *Service) PutObj(key, bucket string, data []byte) error

PutObj 添加对象

Jump to

Keyboard shortcuts

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