s3manager

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: AGPL-3.0 Imports: 25 Imported by: 1

Documentation

Index

Constants

View Source
const ContentDefaultType = "application/octet-stream"

Variables

This section is empty.

Functions

func NewFile

func NewFile(mgr *S3Manager, object *minio.Object, name string, memoryUploadMode bool, uploadTmpPath string) *file

Types

type Connector

type Connector func(m *dbschema.NgingCloudStorage) (*minio.Client, error)

type S3Manager

type S3Manager struct {
	EditableMaxSize int
	// contains filtered or unexported fields
}

func New

func New(connector Connector, config *dbschema.NgingCloudStorage, editableMaxSize int) *S3Manager

func (*S3Manager) AWSClient

func (s *S3Manager) AWSClient() (*awsclient.AWSClient, error)

func (*S3Manager) BucketName

func (s *S3Manager) BucketName() string

func (*S3Manager) Chmod

func (s *S3Manager) Chmod(ppath string, mode os.FileMode) error

func (*S3Manager) Chown

func (s *S3Manager) Chown(ppath string, uid, gid int) error

func (*S3Manager) Clear

func (s *S3Manager) Clear(ctx context.Context) error

Clear 清空所有数据【慎用】

func (*S3Manager) Client

func (s *S3Manager) Client() (*minio.Client, error)

func (*S3Manager) ConnError

func (s *S3Manager) ConnError() error

func (*S3Manager) Connect

func (s *S3Manager) Connect() (*minio.Client, error)

func (*S3Manager) Copy

func (s *S3Manager) Copy(ctx context.Context, from, to string) error

func (*S3Manager) CreateFile

func (s *S3Manager) CreateFile(ctx echo.Context, ppath string, content string, encoding string) (err error)

func (*S3Manager) Download

func (s *S3Manager) Download(ctx echo.Context, ppath string) error

func (*S3Manager) Edit

func (s *S3Manager) Edit(ctx echo.Context, ppath string, content string, encoding string) (interface{}, error)

func (*S3Manager) ErrIsAccessDenied

func (s *S3Manager) ErrIsAccessDenied(err error) bool

func (*S3Manager) ErrIsNotExist

func (s *S3Manager) ErrIsNotExist(err error) bool

func (*S3Manager) Exists

func (s *S3Manager) Exists(ctx context.Context, ppath string) (bool, error)

Exists 对象是否存在

func (*S3Manager) FPutObject

func (s *S3Manager) FPutObject(ctx context.Context, filePath string, objectName string) (int64, error)

func (*S3Manager) Get

func (s *S3Manager) Get(ctx context.Context, ppath string) (*minio.Object, error)

Get 获取数据

func (*S3Manager) GetCORSRules