s3

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorReason_name = map[int32]string{
		0: "NOT_ALLOW_EXT",
		1: "CONFIG_NOT_FOUND",
	}
	ErrorReason_value = map[string]int32{
		"NOT_ALLOW_EXT":    0,
		"CONFIG_NOT_FOUND": 1,
	}
)

Enum value maps for ErrorReason.

View Source
var File_fs_s3_ecode_proto protoreflect.FileDescriptor

Functions

func ErrorConfigNotFound added in v0.0.34

func ErrorConfigNotFound(format string, args ...interface{}) *errors.Error

func ErrorNotAllowExt

func ErrorNotAllowExt(format string, args ...interface{}) *errors.Error

为某个枚举单独设置错误码

func IsConfigNotFound added in v0.0.34

func IsConfigNotFound(err error) bool

func IsNotAllowExt

func IsNotAllowExt(err error) bool

为某个枚举单独设置错误码

func New

func New(c *fs.Conf) (s3Sess fs.FileStorage, err error)

Types

type ErrorReason

type ErrorReason int32
const (
	// 为某个枚举单独设置错误码
	ErrorReason_NOT_ALLOW_EXT    ErrorReason = 0
	ErrorReason_CONFIG_NOT_FOUND ErrorReason = 1
)

func (ErrorReason) Descriptor

func (ErrorReason) Enum

func (x ErrorReason) Enum() *ErrorReason

func (ErrorReason) EnumDescriptor deprecated

func (ErrorReason) EnumDescriptor() ([]byte, []int)

Deprecated: Use ErrorReason.Descriptor instead.

func (ErrorReason) Number

func (x ErrorReason) Number() protoreflect.EnumNumber

func (ErrorReason) String

func (x ErrorReason) String() string

func (ErrorReason) Type

type S3Session

type S3Session struct {
	// contains filtered or unexported fields
}

func (*S3Session) CopyObject added in v0.0.30

func (c *S3Session) CopyObject(ctx context.Context, bucket, dir, filename string, src string) (string, error)

func (*S3Session) UploadAdminResource added in v0.1.0

func (c *S3Session) UploadAdminResource(ctx context.Context, file multipart.File, fileHeader *multipart.FileHeader) (string, error)

func (*S3Session) UploadApiAvatarDoc added in v0.1.0

func (c *S3Session) UploadApiAvatarDoc(ctx context.Context, file multipart.File, fileHeader *multipart.FileHeader, dir string, userId, docId int64) (string, error)

func (*S3Session) UploadBytes

func (c *S3Session) UploadBytes(ctx context.Context, fileName string, data []byte) (string, error)

func (*S3Session) UploadBytesToBucketDir added in v0.0.28

func (c *S3Session) UploadBytesToBucketDir(ctx context.Context, bucket, dir, fileName string, data []byte) (string, error)

func (*S3Session) UploadBytesToDir added in v0.0.26

func (c *S3Session) UploadBytesToDir(ctx context.Context, dir, fileName string, data []byte) (string, error)

func (*S3Session) UploadImage

func (c *S3Session) UploadImage(ctx context.Context, imagePath string, fileName string, proxy *url.URL) (string, error)

func (*S3Session) UploadLazyMintFile added in v0.1.0

func (c *S3Session) UploadLazyMintFile(ctx context.Context, file multipart.File, fileHeader *multipart.FileHeader) (string, error)

func (*S3Session) UploadMultipart

func (c *S3Session) UploadMultipart(ctx context.Context, fileHeader *multipart.FileHeader) (externalUrl string, err error)

Jump to

Keyboard shortcuts

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