Documentation
¶
Index ¶
Constants ¶
View Source
const ( OSS_TYPE_LOCAL = "local" OSS_TYPE_S3 = "aws_s3" OSS_TYPE_TENCENT_COS = "tencent_cos" OSS_TYPE_AZURE_BLOB = "azure_blob" OSS_TYPE_GCS = "gcs" OSS_TYPE_ALIYUN_OSS = "aliyun_oss" OSS_TYPE_HUAWEI_OBS = "huawei_obs" OSS_TYPE_VOLCENGINE_TOS = "volcengine_tos" )
OSS supports different types of object storage services such as local file system, AWS S3, and Tencent COS. The interface defines methods for saving, loading, checking existence,
Variables ¶
View Source
var ( ErrProviderNotFound = NewCloudKitError("provider not found", "") ErrArgumentInvalid = NewCloudKitError("argument invalid", "") ErrProviderInit = NewCloudKitError("provider init error", "") )
Functions ¶
This section is empty.
Types ¶
type AliyunOSS ¶
type CloudKitError ¶
func NewCloudKitError ¶
func NewCloudKitError(reason string, detail string) *CloudKitError
func (*CloudKitError) Error ¶
func (c *CloudKitError) Error() string
func (*CloudKitError) WithDetail ¶
func (c *CloudKitError) WithDetail(detail string) *CloudKitError
func (*CloudKitError) WithError ¶
func (c *CloudKitError) WithError(err error) *CloudKitError
type GoogleCloudStorage ¶
func (*GoogleCloudStorage) Validate ¶
func (g *GoogleCloudStorage) Validate() error
type HuaweiOBS ¶
type OSS ¶
type OSS interface {
// Save saves data into path key
Save(key string, data []byte) error
// Load loads data from path key
Load(key string) ([]byte, error)
// Exists checks if the data exists in the path key
Exists(key string) (bool, error)
// State gets the state of the data in the path key
State(key string) (OSSState, error)
// List lists all the data with the given prefix, and all the paths are absolute paths
List(prefix string) ([]OSSPath, error)
// Delete deletes the data in the path key
Delete(key string) error
// Type returns the type of the storage
// For example: local, aws_s3, tencent_cos
Type() string
}
type OSSArgs ¶
type OSSArgs struct {
S3 *S3
Local *Local
AzureBlob *AzureBlob
AliyunOSS *AliyunOSS
TencentCOS *TencentCOS
GoogleCloudStorage *GoogleCloudStorage
HuaweiOBS *HuaweiOBS
VolcengineTOS *VolcengineTOS
}
type S3 ¶
Click to show internal directories.
Click to hide internal directories.