Documentation
¶
Index ¶
- Constants
- func NormalizeOSSACL(level string) string
- func Sign(req *http.Request, cred aliauth.Credential, bucket string, now time.Time) error
- type APIError
- type BucketACLResponse
- type Client
- func (c *Client) GetBucketACL(ctx context.Context, bucket, region string) (string, error)
- func (c *Client) ListBuckets(ctx context.Context, region string) (*ListBucketsResponse, error)
- func (c *Client) ListObjectsV2(ctx context.Context, bucket, region, continuationToken string, maxKeys int) (ListObjectsResponse, error)
- func (c *Client) PutBucketACL(ctx context.Context, bucket, region, acl string) error
- type Driver
- func (d *Driver) AuditBucketACL(ctx context.Context, bucket string) ([]schema.BucketACLEntry, error)
- func (d *Driver) ExposeBucket(ctx context.Context, bucket, level string) (string, error)
- func (d *Driver) GetBuckets(ctx context.Context) ([]schema.Storage, error)
- func (d *Driver) ListObjects(ctx context.Context, buckets map[string]string) ([]schema.BucketResult, error)
- func (d *Driver) NewClient() (*Client, error)
- func (d *Driver) TotalObjects(ctx context.Context, buckets map[string]string) ([]schema.BucketResult, error)
- func (d *Driver) UnexposeBucket(ctx context.Context, bucket string) error
- type ListBucketsResponse
- type ListObjectsResponse
- type OSSBucket
- type OSSObject
- type Option
Constants ¶
const ( OSSACLPrivate = "private" OSSACLPublicRead = "public-read" OSSACLPublicReadWrite = "public-read-write" )
Alibaba OSS canned ACL values. Levels accepted by the bucket-acl-check payload map onto these via NormalizeOSSACL.
Variables ¶
This section is empty.
Functions ¶
func NormalizeOSSACL ¶ added in v0.3.1
NormalizeOSSACL maps user-friendly aliases to the canned OSS ACL values.
Types ¶
type BucketACLResponse ¶ added in v0.3.1
type BucketACLResponse struct {
XMLName xml.Name `xml:"AccessControlPolicy"`
Owner struct {
ID string `xml:"ID"`
DisplayName string `xml:"DisplayName"`
} `xml:"Owner"`
AccessControlList struct {
Grant string `xml:"Grant"`
} `xml:"AccessControlList"`
}
BucketACLResponse maps the body returned by `GET /?acl` on a bucket. The canned ACL value lives at AccessControlPolicy/AccessControlList/Grant and is one of "private", "public-read", or "public-read-write".
type Client ¶ added in v0.2.2
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetBucketACL ¶ added in v0.3.1
GetBucketACL returns the canned ACL grant ("private" / "public-read" / "public-read-write") currently set on bucket.
func (*Client) ListBuckets ¶ added in v0.2.2
func (*Client) ListObjectsV2 ¶ added in v0.2.2
type Driver ¶ added in v0.0.9
type Driver struct {
Cred aliauth.Credential
Region string
Client *Client
// contains filtered or unexported fields
}
func (*Driver) AuditBucketACL ¶ added in v0.3.1
func (d *Driver) AuditBucketACL(ctx context.Context, bucket string) ([]schema.BucketACLEntry, error)
AuditBucketACL enumerates buckets in scope and returns their canned ACL state. When bucket is empty all buckets are audited; otherwise the named bucket is audited if found.
func (*Driver) ExposeBucket ¶ added in v0.3.1
ExposeBucket sets bucket public-readable. level overrides the default `public-read` (e.g. `public-read-write`) if the caller wants a stronger expose.
func (*Driver) GetBuckets ¶ added in v0.0.9
func (*Driver) ListObjects ¶ added in v0.1.0
func (*Driver) TotalObjects ¶ added in v0.1.0
func (d *Driver) TotalObjects(ctx context.Context, buckets map[string]string) ([]schema.BucketResult, error)
Recommended:
./ossutil64 du oss://examplebucket/dir/ --block-size GB
Links:
https://help.aliyun.com/document_detail/129732.html https://github.com/aliyun/ossutil
type ListBucketsResponse ¶ added in v0.2.2
type ListObjectsResponse ¶ added in v0.2.2
type ListObjectsResponse struct {
XMLName xml.Name `xml:"ListBucketResult"`
Name string `xml:"Name"`
Prefix string `xml:"Prefix"`
StartAfter string `xml:"StartAfter"`
ContinuationToken string `xml:"ContinuationToken"`
MaxKeys int `xml:"MaxKeys"`
Delimiter string `xml:"Delimiter"`
IsTruncated bool `xml:"IsTruncated"`
NextContinuationToken string `xml:"NextContinuationToken"`
Objects []OSSObject `xml:"Contents"`
}
type Option ¶ added in v0.2.2
type Option func(*Client)
func WithHTTPClient ¶ added in v0.2.2
func WithRetryPolicy ¶ added in v0.2.2
func WithRetryPolicy(policy api.RetryPolicy) Option