mock

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ETag

func ETag(b []byte, psize int64) string

func RandBytes

func RandBytes(seed uint64, size int64) []byte

Types

type Object

type Object struct {
	Key           string
	Body          []byte
	LastModified  time.Time
	ContentLength int64
}

func DirectoryList

func DirectoryList(numFiles, numDirs int, prefix string) []*Object

func StorageRoot

func StorageRoot(seed uint64, prefix string, numObjects int) []*Object

type S3API

type S3API struct {
	UpdatedETags map[string]string
	Deleted      map[string]bool
	MPUCreated   bool
	MPUAborted   bool
	MPUComplete  bool

	CopyObjectFunc func(context.Context, *s3v2.CopyObjectInput, ...func(*s3v2.Options)) (*s3v2.CopyObjectOutput, error)
	// contains filtered or unexported fields
}

func New

func New(bucket string, objects ...*Object) *S3API

func (*S3API) AbortMultipartUpload

func (m *S3API) AbortMultipartUpload(ctx context.Context, in *s3v2.AbortMultipartUploadInput, opts ...func(*s3v2.Options)) (*s3v2.AbortMultipartUploadOutput, error)

func (*S3API) CompleteMultipartUpload

func (m *S3API) CompleteMultipartUpload(ctx context.Context, in *s3v2.CompleteMultipartUploadInput, opts ...func(*s3v2.Options)) (*s3v2.CompleteMultipartUploadOutput, error)

func (*S3API) CopyObject

func (m *S3API) CopyObject(ctx context.Context, in *s3v2.CopyObjectInput, opts ...func(*s3v2.Options)) (*s3v2.CopyObjectOutput, error)

func (*S3API) CreateMultipartUpload

func (m *S3API) CreateMultipartUpload(ctx context.Context, in *s3v2.CreateMultipartUploadInput, opts ...func(*s3v2.Options)) (*s3v2.CreateMultipartUploadOutput, error)

func (*S3API) DeleteObject

func (m *S3API) DeleteObject(ctx context.Context, in *s3v2.DeleteObjectInput, opts ...func(*s3v2.Options)) (*s3v2.DeleteObjectOutput, error)

func (*S3API) GetObject

func (m *S3API) GetObject(ctx context.Context, in *s3v2.GetObjectInput, opts ...func(*s3v2.Options)) (*s3v2.GetObjectOutput, error)

func (*S3API) HeadObject

func (m *S3API) HeadObject(ctx context.Context, in *s3v2.HeadObjectInput, opts ...func(*s3v2.Options)) (*s3v2.HeadObjectOutput, error)

func (*S3API) ListObjectsV2

func (m *S3API) ListObjectsV2(ctx context.Context, in *s3v2.ListObjectsV2Input, opts ...func(*s3v2.Options)) (*s3v2.ListObjectsV2Output, error)

func (*S3API) PartCount

func (m *S3API) PartCount() int

func (*S3API) PartETag

func (m *S3API) PartETag(num int32) string

func (*S3API) PutObject

func (m *S3API) PutObject(ctx context.Context, in *s3v2.PutObjectInput, opts ...func(*s3v2.Options)) (*s3v2.PutObjectOutput, error)

func (*S3API) UploadPart

func (m *S3API) UploadPart(ctx context.Context, in *s3v2.UploadPartInput, opts ...func(*s3v2.Options)) (*s3v2.UploadPartOutput, error)

func (*S3API) UploadPartCopy

func (m *S3API) UploadPartCopy(ctx context.Context, in *s3v2.UploadPartCopyInput, opts ...func(*s3v2.Options)) (*s3v2.UploadPartCopyOutput, error)

Jump to

Keyboard shortcuts

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