Documentation ¶
Index ¶
- func ParsePathStyle(url string) (bucketName string, appId string, key string, err error)
- func ParseVirtualHostedStyle(url string) (bucketName string, appId string, key string, err error)
- func QCloudEndpoint(host, region string) string
- func RawEndpoint(host, region string) string
- type Bucket
- func (x Bucket) Client() *s3.S3
- func (x Bucket) Copy(ctx context.Context, sourceUrl, targetKey string) (string, error)
- func (x Bucket) Delete(ctx context.Context, url string) error
- func (x Bucket) Download(ctx context.Context, url string) ([]byte, error)
- func (x Bucket) Get(ctx context.Context, url string) ([]byte, error)
- func (x Bucket) List(ctx context.Context, url string, latestKey *string, maxKeys int64) ([]string, *string, error)
- func (x Bucket) Presign(keyOrUrl string, expire time.Duration) (putUrl string, getUrl string, err error)
- func (x Bucket) Put(ctx context.Context, key string, buffer []byte) (string, error)
- type Configuration
- type Endpoint
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParsePathStyle ¶
func ParseVirtualHostedStyle ¶
func QCloudEndpoint ¶
func RawEndpoint ¶
Types ¶
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
func NewBucket ¶
func NewBucket(c *Configuration, endpoint Endpoint, opts ...Option) (*Bucket, error)
type Configuration ¶
type Configuration struct { Host string `yaml:"host"` BucketName string `yaml:"bucket_name"` AppId string `yaml:"app_id"` Region string `yaml:"region"` SecretId string `yaml:"secret_id"` SecretKey string `yaml:"secret_key"` Token string `yaml:"token"` }
func (*Configuration) Init ¶
func (c *Configuration) Init() error
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithDisableSSL ¶
func WithDisableSSL() Option
func WithMaxIdleConns ¶
func WithPathStyle ¶
func WithPathStyle() Option
Click to show internal directories.
Click to hide internal directories.