tos

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 BucketItem struct {
	Key           string `json:"Key"`
	LastModified  string `json:"LastModified"`
	ETag          string `json:"ETag"`
	Size          int64  `json:"Size"`
	StorageClass  string `json:"StorageClass"`
	Type          string `json:"Type"`
	HashCrc64ECMA string `json:"HashCrc64ecma"`
}

type Client

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

func NewClient

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

func (*Client) ListBuckets

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

func (*Client) ListObjectsV2

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

type Driver

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

func NewDriver

func NewDriver(cred auth.Credential, region string, opts ...Option) *Driver

func (*Driver) GetBuckets

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

func (*Driver) ListObjects

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

func (*Driver) NewClient

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

func (*Driver) TotalObjects

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

type ListBucketsOutput

type ListBucketsOutput struct {
	Buckets []Bucket `json:"Buckets"`
	Owner   struct {
		ID string `json:"ID"`
	} `json:"Owner"`
}

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"`
}

type Option

type Option func(*Client)

func WithBaseURL

func WithBaseURL(rawURL string) Option

func WithClock

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

func WithHTTPClient

func WithHTTPClient(hc *http.Client) Option

func WithRetryPolicy

func WithRetryPolicy(p volcapi.RetryPolicy) Option

Jump to

Keyboard shortcuts

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