Documentation
¶
Index ¶
- Constants
- func NormalizeTOSACL(level string) string
- type Bucket
- type BucketItem
- type Client
- func (c *Client) GetBucketACL(ctx context.Context, bucket, region string) (string, error)
- func (c *Client) ListBuckets(ctx context.Context, region string) (ListBucketsOutput, error)
- func (c *Client) ListObjectsV2(ctx context.Context, bucket, region, token string, maxKeys int) (ListObjectsV2Output, 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 GetBucketACLOutput
- type ListBucketsOutput
- type ListObjectsV2Output
- type Option
Constants ¶
const ( TOSACLPrivate = "private" TOSACLPublicRead = "public-read" TOSACLPublicReadWrite = "public-read-write" TOSACLAuthenticatedRead = "authenticated-read" TOSACLBucketOwnerRead = "bucket-owner-read" TOSACLBucketOwnerFullControl = "bucket-owner-full-control" )
TOS canned ACL values. PUT bucket ACL accepts these via the `x-tos-acl` header; GET bucket ACL replies with a Grants list that we collapse back to one of these canonical values for the bucket-acl-check `audit` view.
Variables ¶
This section is empty.
Functions ¶
func NormalizeTOSACL ¶ added in v0.3.1
NormalizeTOSACL maps user-friendly aliases to canned TOS ACL values.
Types ¶
type Bucket ¶
type Bucket struct {
Name string `json:"Name"`
CreationDate string `json:"CreationDate"`
Location string `json:"Location"`
ExtranetEndpoint string `json:"ExtranetEndpoint"`
IntranetEndpoint string `json:"IntranetEndpoint"`
ProjectName string `json:"ProjectName"`
BucketType string `json:"BucketType"`
}
type BucketItem ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetBucketACL ¶ added in v0.3.1
GetBucketACL returns the canned ACL value for bucket. The TOS data plane returns a permission grant list rather than a direct canned value, so the helper collapses Grants back into one of the TOSACL* constants.
func (*Client) ListBuckets ¶
func (*Client) ListObjectsV2 ¶
type Driver ¶
type Driver struct {
Cred auth.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.
func (*Driver) ExposeBucket ¶ added in v0.3.1
ExposeBucket sets the bucket public-readable (defaults to public-read).
func (*Driver) GetBuckets ¶
func (*Driver) ListObjects ¶
func (*Driver) TotalObjects ¶
type GetBucketACLOutput ¶ added in v0.3.1
type GetBucketACLOutput struct {
Owner struct {
ID string `json:"ID"`
} `json:"Owner"`
Grants []struct {
Grantee struct {
Type string `json:"Type"`
URI string `json:"Canned"`
ID string `json:"ID"`
} `json:"Grantee"`
Permission string `json:"Permission"`
} `json:"Grants"`
}
GetBucketACLOutput captures the JSON returned by `GET /?acl`. Only the fields needed to derive a canonical ACL string are kept.
type ListBucketsOutput ¶
type ListObjectsV2Output ¶
type ListObjectsV2Output struct {
Name string `json:"Name"`
Prefix string `json:"Prefix"`
MaxKeys int `json:"MaxKeys"`
Delimiter string `json:"Delimiter"`
EncodingType string `json:"EncodingType"`
IsTruncated bool `json:"IsTruncated"`
ContinuationToken string `json:"ContinuationToken"`
NextContinuationToken string `json:"NextContinuationToken"`
Contents []BucketItem `json:"Contents"`
}