Documentation
¶
Index ¶
- Constants
- Variables
- func HTTPHeaderLastModifiedToTime(timeStr string) (time.Time, error)
- type AWSObjectStorageService
- func (service *AWSObjectStorageService) DeleteObject(ctx context.Context, key string) error
- func (service *AWSObjectStorageService) DeleteObjects(ctx context.Context, keys ...string) error
- func (service *AWSObjectStorageService) GetObject(ctx context.Context, key string) (Object, error)
- func (service *AWSObjectStorageService) GetSignedURL(key string, duration time.Duration) (string, error)
- func (service *AWSObjectStorageService) GetSignedURLForExistedKey(ctx context.Context, key string, duration time.Duration) (string, error)
- func (service *AWSObjectStorageService) HeadObject(ctx context.Context, key string) (Object, error)
- func (service *AWSObjectStorageService) ListObjects(ctx context.Context, prefix string, continueToken *string, maxObjects int) ([]Object, *string, error)
- func (service *AWSObjectStorageService) PutObject(ctx context.Context, key string, input *PutObjectInput) error
- func (service *AWSObjectStorageService) PutSignedURL(key string, duration time.Duration, option PutHeaderOption) (string, error)
- type AliCloudObjectStorageService
- func (service *AliCloudObjectStorageService) DeleteObject(ctx context.Context, key string) error
- func (service *AliCloudObjectStorageService) DeleteObjects(ctx context.Context, keys ...string) error
- func (service *AliCloudObjectStorageService) GetObject(ctx context.Context, key string) (Object, error)
- func (service *AliCloudObjectStorageService) GetSignedURL(key string, duration time.Duration) (string, error)
- func (service *AliCloudObjectStorageService) GetSignedURLForExistedKey(ctx context.Context, key string, duration time.Duration) (string, error)
- func (service *AliCloudObjectStorageService) HeadObject(ctx context.Context, key string) (Object, error)
- func (service *AliCloudObjectStorageService) ListObjects(ctx context.Context, prefix string, continueToken *string, maxObjects int) ([]Object, *string, error)
- func (service *AliCloudObjectStorageService) PutObject(ctx context.Context, key string, input *PutObjectInput) error
- func (service *AliCloudObjectStorageService) PutSignedURL(key string, duration time.Duration, option PutHeaderOption) (string, error)
- type AliCloudStorageOption
- func (option AliCloudStorageOption) CheckAWS() error
- func (option AliCloudStorageOption) CheckAliCloudStorage() error
- func (option AliCloudStorageOption) CheckClusterRedis() error
- func (option AliCloudStorageOption) CheckStandaloneRedis() error
- func (option AliCloudStorageOption) CheckTencentCloud() error
- func (option AliCloudStorageOption) GetAssumeRegion() string
- func (option AliCloudStorageOption) GetAssumeRoleArn() string
- func (option AliCloudStorageOption) GetProvider() cloud.Provider
- func (option AliCloudStorageOption) GetRegion() string
- func (option AliCloudStorageOption) GetSecretID() string
- func (option AliCloudStorageOption) GetSecretKey() string
- type COSOption
- type Object
- type ObjectStorageOption
- type ObjectStorageService
- func GetAWSObjectService(bucketName string, option cloud.Option) (ObjectStorageService, error)
- func GetAliCloudObjectService(bucketName string, option cloud.Option) (ObjectStorageService, error)
- func GetObjectStorageService(bucketName string, option cloud.Option) (ObjectStorageService, error)
- func GetObjectStorageServiceWithOption(option ObjectStorageOption) (ObjectStorageService, error)
- func GetTencentCloudObjectService(bucketName string, option cloud.Option) (ObjectStorageService, error)
- type PutHeaderOption
- type PutObjectInput
- type TencentCloudObjectStorageService
- func (service *TencentCloudObjectStorageService) DeleteObject(ctx context.Context, key string) error
- func (service *TencentCloudObjectStorageService) DeleteObjects(ctx context.Context, keys ...string) error
- func (service *TencentCloudObjectStorageService) GetObject(ctx context.Context, key string) (Object, error)
- func (service *TencentCloudObjectStorageService) GetSignedURL(key string, duration time.Duration) (string, error)
- func (service *TencentCloudObjectStorageService) GetSignedURLForExistedKey(ctx context.Context, key string, duration time.Duration) (string, error)
- func (service *TencentCloudObjectStorageService) HeadObject(ctx context.Context, key string) (Object, error)
- func (service *TencentCloudObjectStorageService) ListObjects(ctx context.Context, prefix string, continueToken *string, maxObjects int) ([]Object, *string, error)
- func (service *TencentCloudObjectStorageService) PutObject(ctx context.Context, key string, input *PutObjectInput) error
- func (service *TencentCloudObjectStorageService) PutSignedURL(key string, duration time.Duration, option PutHeaderOption) (string, error)
Constants ¶
View Source
const ( AliCloudEnvRoleArn = "ALIBABA_CLOUD_ROLE_ARN" AliCloudEnvOidcProviderArn = "ALIBABA_CLOUD_OIDC_PROVIDER_ARN" AliCloudEnvOidcTokenFile = "ALIBABA_CLOUD_OIDC_TOKEN_FILE" )
Variables ¶
View Source
var ( ErrAliCloudStorageServiceCredentialTypeEmpty = errors.New("credential_type for alicloud storage service is empty") ErrAliCloudStorageServiceEndPointEmpty = errors.New("endpoint for alicloud storage service is empty") ErrAliCloudStorageServiceSessionNameEmpty = errors.New("session_name for alicloud storage service is empty") ErrAliCloudStorageServiceAccessKeyIDEmpty = errors.New("access_key_id for alicloud storage service is empty") ErrAliCloudStorageServiceAccessKeySecretEmpty = errors.New("access_key_secret for alicloud storage service is empty") )
Functions ¶
Types ¶
type AWSObjectStorageService ¶
type AWSObjectStorageService struct {
// contains filtered or unexported fields
}
func (*AWSObjectStorageService) DeleteObject ¶
func (service *AWSObjectStorageService) DeleteObject(ctx context.Context, key string) error
func (*AWSObjectStorageService) DeleteObjects ¶
func (service *AWSObjectStorageService) DeleteObjects(ctx context.Context, keys ...string) error
func (*AWSObjectStorageService) GetSignedURL ¶
func (*AWSObjectStorageService) GetSignedURLForExistedKey ¶ added in v1.1.1
func (*AWSObjectStorageService) HeadObject ¶ added in v1.1.1
func (*AWSObjectStorageService) ListObjects ¶
func (*AWSObjectStorageService) PutObject ¶
func (service *AWSObjectStorageService) PutObject(ctx context.Context, key string, input *PutObjectInput) error
func (*AWSObjectStorageService) PutSignedURL ¶ added in v1.3.6
func (service *AWSObjectStorageService) PutSignedURL(key string, duration time.Duration, option PutHeaderOption) (string, error)
type AliCloudObjectStorageService ¶ added in v1.3.0
type AliCloudObjectStorageService struct {
// contains filtered or unexported fields
}
func (*AliCloudObjectStorageService) DeleteObject ¶ added in v1.3.0
func (service *AliCloudObjectStorageService) DeleteObject(ctx context.Context, key string) error
func (*AliCloudObjectStorageService) DeleteObjects ¶ added in v1.3.0
func (service *AliCloudObjectStorageService) DeleteObjects(ctx context.Context, keys ...string) error
func (*AliCloudObjectStorageService) GetSignedURL ¶ added in v1.3.0
func (*AliCloudObjectStorageService) GetSignedURLForExistedKey ¶ added in v1.3.0
func (*AliCloudObjectStorageService) HeadObject ¶ added in v1.3.0
func (*AliCloudObjectStorageService) ListObjects ¶ added in v1.3.0
func (*AliCloudObjectStorageService) PutObject ¶ added in v1.3.0
func (service *AliCloudObjectStorageService) PutObject(ctx context.Context, key string, input *PutObjectInput) error
func (*AliCloudObjectStorageService) PutSignedURL ¶ added in v1.3.6
func (service *AliCloudObjectStorageService) PutSignedURL(key string, duration time.Duration, option PutHeaderOption) (string, error)
type AliCloudStorageOption ¶ added in v1.3.0
type AliCloudStorageOption struct { CredentialType string `yaml:"credential_type" json:"credential_type"` // eg: "oidc_role_arn" or "ak" EndPoint string `yaml:"endpoint" json:"endpoint"` // eg: "oss-cn-zhangjiakou.aliyuncs.com" SessionName string `yaml:"session_name" json:"session_name"` // eg: "test-rrsa-oidc-token" // "ak" required AccessKeyID string `yaml:"access_key_id" json:"access_key_id"` AccessKeySecret string `yaml:"access_key_secret" json:"access_key_secret"` }
func (AliCloudStorageOption) CheckAWS ¶ added in v1.3.0
func (option AliCloudStorageOption) CheckAWS() error
func (AliCloudStorageOption) CheckAliCloudStorage ¶ added in v1.3.0
func (option AliCloudStorageOption) CheckAliCloudStorage() error
func (AliCloudStorageOption) CheckClusterRedis ¶ added in v1.3.0
func (option AliCloudStorageOption) CheckClusterRedis() error
func (AliCloudStorageOption) CheckStandaloneRedis ¶ added in v1.3.0
func (option AliCloudStorageOption) CheckStandaloneRedis() error
func (AliCloudStorageOption) CheckTencentCloud ¶ added in v1.3.0
func (option AliCloudStorageOption) CheckTencentCloud() error
func (AliCloudStorageOption) GetAssumeRegion ¶ added in v1.3.0
func (option AliCloudStorageOption) GetAssumeRegion() string
func (AliCloudStorageOption) GetAssumeRoleArn ¶ added in v1.3.0
func (option AliCloudStorageOption) GetAssumeRoleArn() string
func (AliCloudStorageOption) GetProvider ¶ added in v1.3.0
func (option AliCloudStorageOption) GetProvider() cloud.Provider
func (AliCloudStorageOption) GetRegion ¶ added in v1.3.0
func (option AliCloudStorageOption) GetRegion() string
func (AliCloudStorageOption) GetSecretID ¶ added in v1.3.0
func (option AliCloudStorageOption) GetSecretID() string
func (AliCloudStorageOption) GetSecretKey ¶ added in v1.3.0
func (option AliCloudStorageOption) GetSecretKey() string
type COSOption ¶ added in v1.4.0
type COSOption cloud.CommonCloudOption
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
func (Object) GetContent ¶
func (Object) GetContentType ¶ added in v1.1.2
func (Object) GetModifiedTime ¶
func (Object) GetObjectSize ¶ added in v1.1.1
type ObjectStorageOption ¶ added in v1.4.0
type ObjectStorageOption struct { Provider cloud.Provider `json:"provider" yaml:"provider"` Bucket string `json:"bucket" yaml:"bucket"` // Path is not used currently. Path string `json:"path" yaml:"path"` S3 cloud.AWSOption `json:"s3" yaml:"s3"` OSS AliCloudStorageOption `json:"oss" yaml:"oss"` COS COSOption `json:"cos" yaml:"cos"` }
func (ObjectStorageOption) Check ¶ added in v1.4.0
func (option ObjectStorageOption) Check() error
type ObjectStorageService ¶
type ObjectStorageService interface { ListObjects(ctx context.Context, prefix string, continueToken *string, maxObjects int) ([]Object, *string, error) HeadObject(ctx context.Context, key string) (Object, error) GetObject(ctx context.Context, key string) (Object, error) PutObject(ctx context.Context, key string, input *PutObjectInput) error DeleteObject(ctx context.Context, key string) error DeleteObjects(ctx context.Context, keys ...string) error GetSignedURL(key string, duration time.Duration) (string, error) // GetSignedURLForExistedKey generates signed url if key exists. If key does not exist, return error GetSignedURLForExistedKey(ctx context.Context, key string, duration time.Duration) (string, error) PutSignedURL(key string, duration time.Duration, option PutHeaderOption) (string, error) }
func GetAWSObjectService ¶
func GetAWSObjectService(bucketName string, option cloud.Option) (ObjectStorageService, error)
GetAWSObjectService is deprecated, use getAWSObjectService instead.
func GetAliCloudObjectService ¶ added in v1.3.0
func GetAliCloudObjectService(bucketName string, option cloud.Option) (ObjectStorageService, error)
GetAliCloudObjectService option.credentialType Only Support "oidc_role_arn"
func GetObjectStorageService ¶
func GetObjectStorageService(bucketName string, option cloud.Option) (ObjectStorageService, error)
GetObjectStorageService is deprecated, use GetObjectStorageServiceWithOption instead.
func GetObjectStorageServiceWithOption ¶ added in v1.4.0
func GetObjectStorageServiceWithOption(option ObjectStorageOption) (ObjectStorageService, error)
func GetTencentCloudObjectService ¶
func GetTencentCloudObjectService(bucketName string, option cloud.Option) (ObjectStorageService, error)
GetTencentCloudObjectService is deprecated, use getTencentCloudObjectService instead.
type PutHeaderOption ¶ added in v1.3.6
type PutHeaderOption struct { ContentDisposition *string ContentEncoding *string ContentMD5 *string ContentType *string ContentLength *int64 Tagging *string }
func (*PutHeaderOption) ToAliCloudOptions ¶ added in v1.3.6
func (o *PutHeaderOption) ToAliCloudOptions() []oss.Option
func (*PutHeaderOption) ToTencentCloudOptions ¶ added in v1.3.6
func (o *PutHeaderOption) ToTencentCloudOptions() *cos.PresignedURLOptions
type PutObjectInput ¶ added in v1.1.2
type TencentCloudObjectStorageService ¶
type TencentCloudObjectStorageService struct {
// contains filtered or unexported fields
}
func (*TencentCloudObjectStorageService) DeleteObject ¶
func (service *TencentCloudObjectStorageService) DeleteObject(ctx context.Context, key string) error
func (*TencentCloudObjectStorageService) DeleteObjects ¶
func (service *TencentCloudObjectStorageService) DeleteObjects(ctx context.Context, keys ...string) error
func (*TencentCloudObjectStorageService) GetSignedURL ¶
func (*TencentCloudObjectStorageService) GetSignedURLForExistedKey ¶ added in v1.1.1
func (*TencentCloudObjectStorageService) HeadObject ¶ added in v1.1.1
func (*TencentCloudObjectStorageService) ListObjects ¶
func (*TencentCloudObjectStorageService) PutObject ¶
func (service *TencentCloudObjectStorageService) PutObject(ctx context.Context, key string, input *PutObjectInput) error
func (*TencentCloudObjectStorageService) PutSignedURL ¶ added in v1.3.6
func (service *TencentCloudObjectStorageService) PutSignedURL(key string, duration time.Duration, option PutHeaderOption) (string, error)
Click to show internal directories.
Click to hide internal directories.