oss

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sign added in v0.2.2

func Sign(req *http.Request, cred aliauth.Credential, bucket string, now time.Time) error

Types

type APIError added in v0.2.2

type APIError struct {
	StatusCode int
	Code       string
	Message    string
	RequestID  string
	HostID     string
}

func (*APIError) Error added in v0.2.2

func (e *APIError) Error() string

type Client added in v0.2.2

type Client struct {
	// contains filtered or unexported fields
}

func NewClient added in v0.2.2

func NewClient(cred aliauth.Credential, opts ...Option) *Client

func (*Client) ListBuckets added in v0.2.2

func (c *Client) ListBuckets(ctx context.Context, region string) (*ListBucketsResponse, error)

func (*Client) ListObjectsV2 added in v0.2.2

func (c *Client) ListObjectsV2(ctx context.Context, bucket, region, continuationToken string, maxKeys int) (ListObjectsResponse, error)

type Driver added in v0.0.9

type Driver struct {
	Cred   aliauth.Credential
	Region string
	Client *Client
	// contains filtered or unexported fields
}

func (*Driver) GetBuckets added in v0.0.9

func (d *Driver) GetBuckets(ctx context.Context) ([]schema.Storage, error)

func (*Driver) ListObjects added in v0.1.0

func (d *Driver) ListObjects(ctx context.Context, buckets map[string]string)

func (*Driver) NewClient added in v0.1.0

func (d *Driver) NewClient() (*Client, error)

func (*Driver) TotalObjects added in v0.1.0

func (d *Driver) TotalObjects(ctx context.Context, buckets map[string]string)

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 ListBucketsResponse struct {
	XMLName     xml.Name    `xml:"ListAllMyBucketsResult"`
	Prefix      string      `xml:"Prefix"`
	Marker      string      `xml:"Marker"`
	MaxKeys     int         `xml:"MaxKeys"`
	IsTruncated bool        `xml:"IsTruncated"`
	NextMarker  string      `xml:"NextMarker"`
	Buckets     []OSSBucket `xml:"Buckets>Bucket"`
}

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 OSSBucket added in v0.2.2

type OSSBucket struct {
	Name     string `xml:"Name"`
	Location string `xml:"Location"`
	Region   string `xml:"Region"`
}

type OSSObject added in v0.2.2

type OSSObject struct {
	Key  string `xml:"Key"`
	Size int64  `xml:"Size"`
}

type Option added in v0.2.2

type Option func(*Client)

func WithClock added in v0.2.2

func WithClock(now func() time.Time) Option

func WithHTTPClient added in v0.2.2

func WithHTTPClient(hc *http.Client) Option

func WithRetryPolicy added in v0.2.2

func WithRetryPolicy(policy api.RetryPolicy) Option

func WithServiceEndpoint added in v0.2.2

func WithServiceEndpoint(rawURL string) Option

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL