storage

package
v0.0.0-...-8108ac3 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitStorage

func InitStorage(conf *config.Configuration)

Types

type CosStorage

type CosStorage struct {
	Appid     string
	Region    string
	SecretId  string
	SecretKey string
}

CosStorage cos存储

func NewCosStorage

func NewCosStorage() *CosStorage

NewCosStorage .

func (*CosStorage) DeleteObject

func (s *CosStorage) DeleteObject(bucketName, objectName string) error

func (*CosStorage) GetObject

func (s *CosStorage) GetObject(bucketName, objectName string, offset, length int64) ([]byte, error)

GetObject .

func (*CosStorage) MakeBucket

func (s *CosStorage) MakeBucket(bucketName string) error

MakeBucket .

func (*CosStorage) PutObject

func (s *CosStorage) PutObject(bucketName, objectName, filePath, contentType string) error

PutObject .

type CustomStorage

type CustomStorage interface {
	// MakeBucket 创建存储桶
	MakeBucket(string) error

	// GetObject 获取存储对象
	GetObject(string, string, int64, int64) ([]byte, error)

	// PutObject 上传存储对象
	PutObject(string, string, string, string) error

	// DeleteObject 删除存储对象
	DeleteObject(string, string) error
}

CustomStorage 存储

type LangGoStorage

type LangGoStorage struct {
	Mux     *sync.RWMutex
	Storage CustomStorage
}

func NewStorage

func NewStorage() *LangGoStorage

type LocalStorage

type LocalStorage struct {
	RootPath string
}

LocalStorage 本地存储

func NewLocalStorage

func NewLocalStorage() *LocalStorage

func (*LocalStorage) DeleteObject

func (s *LocalStorage) DeleteObject(bucketName, objectName string) error

func (*LocalStorage) GetObject

func (s *LocalStorage) GetObject(bucketName, objectName string, offset, length int64) ([]byte, error)

GetObject .

func (*LocalStorage) MakeBucket

func (s *LocalStorage) MakeBucket(bucketName string) error

MakeBucket .

func (*LocalStorage) PutObject

func (s *LocalStorage) PutObject(bucketName, objectName, filePath, contentType string) error

PutObject .

type MinIOStorage

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

MinIOStorage minio存储

func NewMinIOStorage

func NewMinIOStorage() *MinIOStorage

NewMinIOStorage .

func (*MinIOStorage) BucketExists

func (s *MinIOStorage) BucketExists(bucketName string) (bool, error)

BucketExists .

func (*MinIOStorage) DeleteObject

func (s *MinIOStorage) DeleteObject(bucketName, objectName string) error

func (*MinIOStorage) GetObject

func (s *MinIOStorage) GetObject(bucketName, objectName string, offset, length int64) ([]byte, error)

GetObject .

func (*MinIOStorage) MakeBucket

func (s *MinIOStorage) MakeBucket(bucketName string) error

MakeBucket .

func (*MinIOStorage) PutObject

func (s *MinIOStorage) PutObject(bucketName, objectName, filePath, contentType string) error

PutObject .

func (*MinIOStorage) StatObject

func (s *MinIOStorage) StatObject(bucketName, objectName string) (int64, error)

StatObject .

type OssStorage

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

OssStorage oss存储

func NewOssStorage

func NewOssStorage() *OssStorage

NewOssStorage .

func (*OssStorage) DeleteObject

func (s *OssStorage) DeleteObject(bucketName, objectName string) error

func (*OssStorage) GetObject

func (s *OssStorage) GetObject(bucketName, objectName string, offset, length int64) ([]byte, error)

GetObject .

func (*OssStorage) MakeBucket

func (s *OssStorage) MakeBucket(bucketName string) error

MakeBucket .

func (*OssStorage) PutObject

func (s *OssStorage) PutObject(bucketName, objectName, filePath, contentType string) error

PutObject .

Jump to

Keyboard shortcuts

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