Documentation ¶
Index ¶
- func InitStorage(conf *config.Configuration)
- type CosStorage
- func (s *CosStorage) DeleteObject(bucketName, objectName string) error
- func (s *CosStorage) GetObject(bucketName, objectName string, offset, length int64) ([]byte, error)
- func (s *CosStorage) MakeBucket(bucketName string) error
- func (s *CosStorage) PutObject(bucketName, objectName, filePath, contentType string) error
- type CustomStorage
- type LangGoStorage
- type LocalStorage
- func (s *LocalStorage) DeleteObject(bucketName, objectName string) error
- func (s *LocalStorage) GetObject(bucketName, objectName string, offset, length int64) ([]byte, error)
- func (s *LocalStorage) MakeBucket(bucketName string) error
- func (s *LocalStorage) PutObject(bucketName, objectName, filePath, contentType string) error
- type MinIOStorage
- func (s *MinIOStorage) BucketExists(bucketName string) (bool, error)
- func (s *MinIOStorage) DeleteObject(bucketName, objectName string) error
- func (s *MinIOStorage) GetObject(bucketName, objectName string, offset, length int64) ([]byte, error)
- func (s *MinIOStorage) MakeBucket(bucketName string) error
- func (s *MinIOStorage) PutObject(bucketName, objectName, filePath, contentType string) error
- func (s *MinIOStorage) StatObject(bucketName, objectName string) (int64, error)
- type OssStorage
- func (s *OssStorage) DeleteObject(bucketName, objectName string) error
- func (s *OssStorage) GetObject(bucketName, objectName string, offset, length int64) ([]byte, error)
- func (s *OssStorage) MakeBucket(bucketName string) error
- func (s *OssStorage) PutObject(bucketName, objectName, filePath, contentType string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitStorage ¶
func InitStorage(conf *config.Configuration)
Types ¶
type CosStorage ¶
CosStorage cos存储
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 (*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 (*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 .
Click to show internal directories.
Click to hide internal directories.