obs

package
v0.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sign added in v0.2.1

func Sign(req *SignRequest) (http.Header, error)

Types

type APIError added in v0.2.1

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

func (*APIError) Error added in v0.2.1

func (e *APIError) Error() string

type Client added in v0.2.1

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

func NewClient added in v0.2.1

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

func (*Client) ListBuckets added in v0.2.1

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

func (*Client) ListObjects added in v0.2.1

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

type Driver added in v0.0.9

type Driver struct {
	Cred    auth.Credential
	Regions []string
	Client  *Client
}

func (*Driver) GetBuckets added in v0.0.9

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

func (*Driver) ListObjects added in v0.2.1

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

func (*Driver) TotalObjects added in v0.2.1

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

type ListBucketsResponse added in v0.2.1

type ListBucketsResponse struct {
	XMLName xml.Name    `xml:"ListAllMyBucketsResult"`
	Buckets []OBSBucket `xml:"Buckets>Bucket"`
}

type ListObjectsResponse added in v0.2.1

type ListObjectsResponse struct {
	XMLName     xml.Name    `xml:"ListBucketResult"`
	IsTruncated bool        `xml:"IsTruncated"`
	Marker      string      `xml:"Marker"`
	NextMarker  string      `xml:"NextMarker"`
	MaxKeys     int         `xml:"MaxKeys"`
	Name        string      `xml:"Name"`
	Prefix      string      `xml:"Prefix"`
	Objects     []OBSObject `xml:"Contents"`
}

type OBSBucket added in v0.2.1

type OBSBucket struct {
	Name     string `xml:"Name"`
	Location string `xml:"Location"`
}

type OBSObject added in v0.2.1

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

type Option added in v0.2.1

type Option func(*Client)

func WithClock added in v0.2.1

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

func WithHTTPClient added in v0.2.1

func WithHTTPClient(hc *http.Client) Option

func WithRetryPolicy added in v0.2.1

func WithRetryPolicy(p api.RetryPolicy) Option

type SignRequest added in v0.2.1

type SignRequest struct {
	Method    string
	Path      string
	Query     url.Values
	Headers   http.Header
	Scheme    string
	AccessKey string
	SecretKey string
	Timestamp time.Time
}

Jump to

Keyboard shortcuts

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