Documentation
¶
Index ¶
- type AccessMode
- type CloudStorage
- type Config
- type Local
- type RedisMultipartStorage
- type Storage
- func (storage *Storage) CdnDomain() string
- func (storage *Storage) FileSystem() fs.FileSystem
- func (storage *Storage) FullUrl(ctx context.Context, path string) string
- func (storage *Storage) RelativePath(ctx context.Context, path string) string
- func (storage *Storage) SignFullUrl(ctx context.Context, path string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessMode ¶
type AccessMode string
AccessMode 访问模式
const ( Private AccessMode = "private" // 私有读写 PublicRead AccessMode = "public-read" // 公共读 PublicReadWrite AccessMode = "public-read-write" // 公共读写 )
type CloudStorage ¶
type CloudStorage struct {
AccessKey string `json:"access_key"`
AccessSecret string `json:"access_secret"`
Bucket string `json:"bucket"`
Endpoint string `json:"endpoint"`
InternalEndpoint string `json:"internal_endpoint"`
WithInternalEndpoint bool `json:"with_internal_endpoint"`
Region string `json:"region"`
UseSSL bool `json:"use_ssl"`
AccessMode AccessMode `json:"access_mode"`
}
type Config ¶
type Config struct {
Driver string
CdnDomain string `json:"cdn_domain"`
Local Local `json:"local"`
Minio CloudStorage `json:"minio"`
AliOss CloudStorage `json:"ali_oss"`
HwObs CloudStorage `json:"hw_obs"`
TxCos CloudStorage `json:"tx_cos"`
S3 CloudStorage `json:"s3"`
}
type Local ¶
type Local struct {
RootPath string `json:"root_path"`
MultipartStorage local.MultipartStorage `json:"multipart_storage"`
}
type RedisMultipartStorage ¶
type RedisMultipartStorage struct {
// contains filtered or unexported fields
}
RedisMultipartStorage Redis实现的本地文件分片上传状态存储
func NewRedisMultipartStorage ¶
func NewRedisMultipartStorage(client redis.Cmdable, prefix string) *RedisMultipartStorage
func (*RedisMultipartStorage) Delete ¶
func (s *RedisMultipartStorage) Delete(uploadID string) error
func (*RedisMultipartStorage) Get ¶
func (s *RedisMultipartStorage) Get(uploadID string) (*local.MultipartUpload, error)
func (*RedisMultipartStorage) List ¶
func (s *RedisMultipartStorage) List() ([]*local.MultipartUpload, error)
func (*RedisMultipartStorage) Save ¶
func (s *RedisMultipartStorage) Save(upload *local.MultipartUpload) error
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func (*Storage) FileSystem ¶
func (storage *Storage) FileSystem() fs.FileSystem
func (*Storage) RelativePath ¶
Click to show internal directories.
Click to hide internal directories.