mock

package
v4.2.1-rc1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Buckets  map[string]map[string]mockObject
	FakeTags map[string]map[string]string
}

Client is an in-memory implementation of the nodes.StorageClient interface

func New

func New(buckets ...string) *Client

New creates a new mock Client with an optional list of buckets

func (*Client) AbortMultipartUpload

func (c *Client) AbortMultipartUpload(ctx context.Context, bucket, object, uploadID string) error

func (*Client) BucketNotifications added in v4.0.1

func (c *Client) BucketNotifications(ctx context.Context, bucketName string, prefix string, events []string) (<-chan interface{}, error)

func (*Client) BucketTags added in v4.0.1

func (c *Client) BucketTags(ctx context.Context, bucketName string) (map[string]string, error)

func (*Client) CompleteMultipartUpload

func (c *Client) CompleteMultipartUpload(ctx context.Context, bucket, object, uploadID string, parts []models.MultipartObjectPart) (string, error)

func (*Client) CopyObject

func (c *Client) CopyObject(ctx context.Context, sourceBucket, sourceObject, destBucket, destObject string, srcMeta, metadata map[string]string, progress io.Reader) (models.ObjectInfo, error)

func (*Client) CopyObjectMultipart

func (c *Client) CopyObjectMultipart(ctx context.Context, srcObject models.ObjectInfo, srcBucket, srcPath, destBucket, destPath string, meta map[string]string, progress io.Reader) error

func (*Client) CopyObjectMultipartThreshold

func (c *Client) CopyObjectMultipartThreshold() int64

func (*Client) GetObject

func (c *Client) GetObject(ctx context.Context, bucketName, objectName string, opts models.ReadMeta) (io.ReadCloser, models.ObjectInfo, error)

func (*Client) ListBuckets

func (c *Client) ListBuckets(ctx context.Context) (bb []models.BucketInfo, e error)

func (*Client) ListMultipartUploads

func (c *Client) ListMultipartUploads(ctx context.Context, bucket, prefix, keyMarker, uploadIDMarker, delimiter string, maxUploads int) (result models.ListMultipartUploadsResult, err error)

func (*Client) ListObjectParts

func (c *Client) ListObjectParts(ctx context.Context, bucketName, objectName, uploadID string, partNumberMarker, maxParts int) (models.ListObjectPartsResult, error)

func (*Client) ListObjects

func (c *Client) ListObjects(ctx context.Context, bucketName, prefix, marker, delimiter string, max ...int) (result models.ListBucketResult, err error)

func (*Client) MakeBucket

func (c *Client) MakeBucket(ctx context.Context, bucketName string, location string) (err error)

func (*Client) NewMultipartUpload

func (c *Client) NewMultipartUpload(ctx context.Context, bucket, object string, opts models.PutMeta) (uploadID string, err error)

func (*Client) PutObject

func (c *Client) PutObject(ctx context.Context, bucketName, objectName string, reader io.Reader, objectSize int64, opts models.PutMeta) (n models.ObjectInfo, err error)

func (*Client) PutObjectPart

func (c *Client) PutObjectPart(ctx context.Context, bucket, object, uploadID string, partID int, data io.Reader, size int64, md5Base64, sha256Hex string) (models.MultipartObjectPart, error)

func (*Client) RemoveBucket

func (c *Client) RemoveBucket(ctx context.Context, bucketName string) error

func (*Client) RemoveObject

func (c *Client) RemoveObject(ctx context.Context, bucketName, objectName string) error

func (*Client) StatObject

func (c *Client) StatObject(ctx context.Context, bucketName, objectName string, opts models.ReadMeta) (models.ObjectInfo, error)

Jump to

Keyboard shortcuts

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