client

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUploader

func NewUploader(opts ...Opt) *uploader

Types

type Client

type Client struct {
	*client.Client
}

func New

func New(url string, opts ...client.ClientOpt) (*Client, error)

Create a new client

func (*Client) CreateBucket

func (c *Client) CreateBucket(ctx context.Context, bucket schema.BucketMeta) (*schema.Bucket, error)

func (*Client) CreateObjects

func (c *Client) CreateObjects(ctx context.Context, bucket, path string, opts ...Opt) (*schema.ObjectList, error)

Create objects from a file or directory

func (*Client) DeleteBucket

func (c *Client) DeleteBucket(ctx context.Context, bucket string) error

func (*Client) DeleteObject

func (c *Client) DeleteObject(ctx context.Context, bucket, key string) error

func (*Client) GetBucket

func (c *Client) GetBucket(ctx context.Context, bucket string) (*schema.Bucket, error)

func (*Client) GetObject

func (c *Client) GetObject(ctx context.Context, bucket, key string) (*schema.Object, error)

func (*Client) ListBuckets

func (c *Client) ListBuckets(ctx context.Context) ([]schema.Bucket, error)

func (*Client) ListObjects

func (c *Client) ListObjects(ctx context.Context, bucket string, opts ...Opt) ([]schema.Object, error)

type Opt

type Opt func(*opt) error

An Option to set on the client

func OptSet

func OptSet(k, v string) Opt

func WithPrefix

func WithPrefix(v *string) Opt

Set prefix for listing objects

func WithProgress

func WithProgress(fn ProgressFunc) Opt

Set progress function for uploader

type ProgressFunc

type ProgressFunc func(cur, total uint64)

Uploader progress function

type Uploader

type Uploader interface {
	// Add one or more files to the request, with the given form name and
	// path. If the path is relative, it is changed to an absolute path.
	// If the path is a directory, all files under that path are uploaded
	// recursively.
	Add(name string, path ...string) error
}

Jump to

Keyboard shortcuts

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