buckettest

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockBucket

type MockBucket struct {
	StubIn
	StubOut
}

MockBucket mock bucket

func (*MockBucket) DeleteObject

func (m *MockBucket) DeleteObject(key string, options ...oss.Option) error

DeleteObject mock DeleteObject

func (*MockBucket) GetObject

func (m *MockBucket) GetObject(key string, options ...oss.Option) (io.ReadCloser, error)

GetObject mock GetObject

func (*MockBucket) IsObjectExist

func (m *MockBucket) IsObjectExist(key string, options ...oss.Option) (bool, error)

IsObjectExist mock IsObjectExist

func (*MockBucket) PutObject

func (m *MockBucket) PutObject(key string, reader io.Reader, options ...oss.Option) error

PutObject mock PutObject

func (m *MockBucket) PutSymlink(symObjectKey string, targetObjectKey string, options ...oss.Option) error

PutSymlink mock PutSymlink

type StubIn

type StubIn struct {
	GetObjectReturn    io.ReadCloser
	GetObjectReturnErr error

	PutObjectReturnErr error

	DeleteObjectReturnErr error

	IsObjectExistReturn    bool
	IsObjectExistReturnErr error

	PutSymlinkReturnErr error
}

StubIn mock calling source

type StubOut

type StubOut struct {
	GetObjectCallTimes   int
	GetObjectCallKey     []string
	GetObjectCallOptions [][]oss.Option

	PutObjectCallTimes   int
	PutObjectCallKey     []string
	PutObjectCallReader  []io.Reader
	PutObjectCallOptions [][]oss.Option

	DeleteObjectCallTimes   int
	DeleteObjectCallKey     []string
	DeleteObjectCallOptions [][]oss.Option

	IsObjectExistCallTimes   int
	IsObjectExistCallKey     []string
	IsObjectExistCallOptions [][]oss.Option

	PutSymlinkCallTimes     int
	PutSymlinkCallSymKey    []string
	PutSymlinkCallTargetKey []string
	PutSymlinkCallOptions   [][]oss.Option
}

StubOut mock calling output

Jump to

Keyboard shortcuts

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