mockobjstore

package
v1.13.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrObjectDoesNotExist = errors.New("object does not exist")

ErrObjectDoesNotExist is used in tests to simulate objstore.Bucket.IsObjNotFoundErr().

Functions

This section is empty.

Types

type MockBucket

type MockBucket struct {
	mock.Mock
}

MockBucket is an autogenerated mock type for the Bucket type

func NewMockBucket

func NewMockBucket(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockBucket

NewMockBucket creates a new instance of MockBucket. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func NewMockBucketWithHelper added in v1.13.0

func NewMockBucketWithHelper(t testing.TB) *MockBucket

func (*MockBucket) Attributes

func (_m *MockBucket) Attributes(ctx context.Context, name string) (objstore.ObjectAttributes, error)

Attributes provides a mock function with given fields: ctx, name

func (*MockBucket) Close

func (_m *MockBucket) Close() error

Close provides a mock function with given fields:

func (*MockBucket) Delete

func (_m *MockBucket) Delete(ctx context.Context, name string) error

Delete provides a mock function with given fields: ctx, name

func (*MockBucket) EXPECT

func (_m *MockBucket) EXPECT() *MockBucket_Expecter

func (*MockBucket) Exists

func (_m *MockBucket) Exists(ctx context.Context, name string) (bool, error)

Exists provides a mock function with given fields: ctx, name

func (*MockBucket) Get

func (_m *MockBucket) Get(ctx context.Context, name string) (io.ReadCloser, error)

Get provides a mock function with given fields: ctx, name

func (*MockBucket) GetRange

func (_m *MockBucket) GetRange(ctx context.Context, name string, off int64, length int64) (io.ReadCloser, error)

GetRange provides a mock function with given fields: ctx, name, off, length

func (*MockBucket) IsAccessDeniedErr

func (_m *MockBucket) IsAccessDeniedErr(err error) bool

IsAccessDeniedErr provides a mock function with given fields: err

func (*MockBucket) IsObjNotFoundErr

func (_m *MockBucket) IsObjNotFoundErr(err error) bool

IsObjNotFoundErr provides a mock function with given fields: err

func (*MockBucket) Iter

func (_m *MockBucket) Iter(ctx context.Context, dir string, f func(string) error, options ...objstore.IterOption) error

Iter provides a mock function with given fields: ctx, dir, f, options

func (*MockBucket) IterWithAttributes added in v1.13.0

func (_m *MockBucket) IterWithAttributes(ctx context.Context, dir string, f func(objstore.IterObjectAttributes) error, options ...objstore.IterOption) error

IterWithAttributes provides a mock function with given fields: ctx, dir, f, options

func (*MockBucket) MockAttributes added in v1.13.0

func (m *MockBucket) MockAttributes(name string, attrs objstore.ObjectAttributes, err error)

func (*MockBucket) MockDelete added in v1.13.0

func (m *MockBucket) MockDelete(name string, err error)

func (*MockBucket) MockExists added in v1.13.0

func (m *MockBucket) MockExists(name string, exists bool, err error)

func (*MockBucket) MockGet added in v1.13.0

func (m *MockBucket) MockGet(name, content string, err error)

MockGet is a convenient method to mock Get() and Exists()

func (*MockBucket) MockIter added in v1.13.0

func (m *MockBucket) MockIter(prefix string, objects []string, err error)

func (*MockBucket) MockIterWithCallback added in v1.13.0

func (m *MockBucket) MockIterWithCallback(prefix string, objects []string, err error, cb func())

MockIterWithCallback is a convenient method to mock Iter() and get a callback called when the Iter API is called.

func (*MockBucket) MockUpload added in v1.13.0

func (m *MockBucket) MockUpload(name string, err error)

func (*MockBucket) Name

func (_m *MockBucket) Name() string

Name provides a mock function with given fields:

func (*MockBucket) Provider added in v1.13.0

func (_m *MockBucket) Provider() objstore.ObjProvider

Provider provides a mock function with given fields:

func (*MockBucket) ReaderAt

func (_m *MockBucket) ReaderAt(ctx context.Context, filename string) (pkgobjstore.ReaderAtCloser, error)

ReaderAt provides a mock function with given fields: ctx, filename

func (*MockBucket) SupportedIterOptions added in v1.13.0

func (_m *MockBucket) SupportedIterOptions() []objstore.IterOptionType

SupportedIterOptions provides a mock function with given fields:

func (*MockBucket) Upload

func (_m *MockBucket) Upload(ctx context.Context, name string, r io.Reader) error

Upload provides a mock function with given fields: ctx, name, r

type MockBucket_Attributes_Call

type MockBucket_Attributes_Call struct {
	*mock.Call
}

MockBucket_Attributes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Attributes'

func (*MockBucket_Attributes_Call) Return

func (*MockBucket_Attributes_Call) Run

func (*MockBucket_Attributes_Call) RunAndReturn

type MockBucket_Close_Call

type MockBucket_Close_Call struct {
	*mock.Call
}

MockBucket_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'

func (*MockBucket_Close_Call) Return

func (*MockBucket_Close_Call) Run

func (_c *MockBucket_Close_Call) Run(run func()) *MockBucket_Close_Call

func (*MockBucket_Close_Call) RunAndReturn

func (_c *MockBucket_Close_Call) RunAndReturn(run func() error) *MockBucket_Close_Call

type MockBucket_Delete_Call

type MockBucket_Delete_Call struct {
	*mock.Call
}

MockBucket_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'

func (*MockBucket_Delete_Call) Return

func (*MockBucket_Delete_Call) Run

func (_c *MockBucket_Delete_Call) Run(run func(ctx context.Context, name string)) *MockBucket_Delete_Call

func (*MockBucket_Delete_Call) RunAndReturn

type MockBucket_Exists_Call

type MockBucket_Exists_Call struct {
	*mock.Call
}

MockBucket_Exists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Exists'

func (*MockBucket_Exists_Call) Return

func (*MockBucket_Exists_Call) Run

func (_c *MockBucket_Exists_Call) Run(run func(ctx context.Context, name string)) *MockBucket_Exists_Call

func (*MockBucket_Exists_Call) RunAndReturn

type MockBucket_Expecter

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

func (*MockBucket_Expecter) Attributes

func (_e *MockBucket_Expecter) Attributes(ctx interface{}, name interface{}) *MockBucket_Attributes_Call

Attributes is a helper method to define mock.On call

  • ctx context.Context
  • name string

func (*MockBucket_Expecter) Close

Close is a helper method to define mock.On call

func (*MockBucket_Expecter) Delete

func (_e *MockBucket_Expecter) Delete(ctx interface{}, name interface{}) *MockBucket_Delete_Call

Delete is a helper method to define mock.On call

  • ctx context.Context
  • name string

func (*MockBucket_Expecter) Exists

func (_e *MockBucket_Expecter) Exists(ctx interface{}, name interface{}) *MockBucket_Exists_Call

Exists is a helper method to define mock.On call

  • ctx context.Context
  • name string

func (*MockBucket_Expecter) Get

func (_e *MockBucket_Expecter) Get(ctx interface{}, name interface{}) *MockBucket_Get_Call

Get is a helper method to define mock.On call

  • ctx context.Context
  • name string

func (*MockBucket_Expecter) GetRange

func (_e *MockBucket_Expecter) GetRange(ctx interface{}, name interface{}, off interface{}, length interface{}) *MockBucket_GetRange_Call

GetRange is a helper method to define mock.On call

  • ctx context.Context
  • name string
  • off int64
  • length int64

func (*MockBucket_Expecter) IsAccessDeniedErr

func (_e *MockBucket_Expecter) IsAccessDeniedErr(err interface{}) *MockBucket_IsAccessDeniedErr_Call

IsAccessDeniedErr is a helper method to define mock.On call

  • err error

func (*MockBucket_Expecter) IsObjNotFoundErr

func (_e *MockBucket_Expecter) IsObjNotFoundErr(err interface{}) *MockBucket_IsObjNotFoundErr_Call

IsObjNotFoundErr is a helper method to define mock.On call

  • err error

func (*MockBucket_Expecter) Iter

func (_e *MockBucket_Expecter) Iter(ctx interface{}, dir interface{}, f interface{}, options ...interface{}) *MockBucket_Iter_Call

Iter is a helper method to define mock.On call

  • ctx context.Context
  • dir string
  • f func(string) error
  • options ...objstore.IterOption

func (*MockBucket_Expecter) IterWithAttributes added in v1.13.0

func (_e *MockBucket_Expecter) IterWithAttributes(ctx interface{}, dir interface{}, f interface{}, options ...interface{}) *MockBucket_IterWithAttributes_Call

IterWithAttributes is a helper method to define mock.On call

  • ctx context.Context
  • dir string
  • f func(objstore.IterObjectAttributes) error
  • options ...objstore.IterOption

func (*MockBucket_Expecter) Name

Name is a helper method to define mock.On call

func (*MockBucket_Expecter) Provider added in v1.13.0

Provider is a helper method to define mock.On call

func (*MockBucket_Expecter) ReaderAt

func (_e *MockBucket_Expecter) ReaderAt(ctx interface{}, filename interface{}) *MockBucket_ReaderAt_Call

ReaderAt is a helper method to define mock.On call

  • ctx context.Context
  • filename string

func (*MockBucket_Expecter) SupportedIterOptions added in v1.13.0

func (_e *MockBucket_Expecter) SupportedIterOptions() *MockBucket_SupportedIterOptions_Call

SupportedIterOptions is a helper method to define mock.On call

func (*MockBucket_Expecter) Upload

func (_e *MockBucket_Expecter) Upload(ctx interface{}, name interface{}, r interface{}) *MockBucket_Upload_Call

Upload is a helper method to define mock.On call

  • ctx context.Context
  • name string
  • r io.Reader

type MockBucket_GetRange_Call

type MockBucket_GetRange_Call struct {
	*mock.Call
}

MockBucket_GetRange_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRange'

func (*MockBucket_GetRange_Call) Return

func (*MockBucket_GetRange_Call) Run

func (_c *MockBucket_GetRange_Call) Run(run func(ctx context.Context, name string, off int64, length int64)) *MockBucket_GetRange_Call

func (*MockBucket_GetRange_Call) RunAndReturn

type MockBucket_Get_Call

type MockBucket_Get_Call struct {
	*mock.Call
}

MockBucket_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'

func (*MockBucket_Get_Call) Return

func (*MockBucket_Get_Call) Run

func (_c *MockBucket_Get_Call) Run(run func(ctx context.Context, name string)) *MockBucket_Get_Call

func (*MockBucket_Get_Call) RunAndReturn

type MockBucket_IsAccessDeniedErr_Call

type MockBucket_IsAccessDeniedErr_Call struct {
	*mock.Call
}

MockBucket_IsAccessDeniedErr_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsAccessDeniedErr'

func (*MockBucket_IsAccessDeniedErr_Call) Return

func (*MockBucket_IsAccessDeniedErr_Call) Run

func (*MockBucket_IsAccessDeniedErr_Call) RunAndReturn

type MockBucket_IsObjNotFoundErr_Call

type MockBucket_IsObjNotFoundErr_Call struct {
	*mock.Call
}

MockBucket_IsObjNotFoundErr_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsObjNotFoundErr'

func (*MockBucket_IsObjNotFoundErr_Call) Return

func (*MockBucket_IsObjNotFoundErr_Call) Run

func (*MockBucket_IsObjNotFoundErr_Call) RunAndReturn

type MockBucket_IterWithAttributes_Call added in v1.13.0

type MockBucket_IterWithAttributes_Call struct {
	*mock.Call
}

MockBucket_IterWithAttributes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IterWithAttributes'

func (*MockBucket_IterWithAttributes_Call) Return added in v1.13.0

func (*MockBucket_IterWithAttributes_Call) Run added in v1.13.0

func (*MockBucket_IterWithAttributes_Call) RunAndReturn added in v1.13.0

type MockBucket_Iter_Call

type MockBucket_Iter_Call struct {
	*mock.Call
}

MockBucket_Iter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Iter'

func (*MockBucket_Iter_Call) Return

func (*MockBucket_Iter_Call) Run

func (_c *MockBucket_Iter_Call) Run(run func(ctx context.Context, dir string, f func(string) error, options ...objstore.IterOption)) *MockBucket_Iter_Call

func (*MockBucket_Iter_Call) RunAndReturn

type MockBucket_Name_Call

type MockBucket_Name_Call struct {
	*mock.Call
}

MockBucket_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name'

func (*MockBucket_Name_Call) Return

func (*MockBucket_Name_Call) Run

func (_c *MockBucket_Name_Call) Run(run func()) *MockBucket_Name_Call

func (*MockBucket_Name_Call) RunAndReturn

func (_c *MockBucket_Name_Call) RunAndReturn(run func() string) *MockBucket_Name_Call

type MockBucket_Provider_Call added in v1.13.0

type MockBucket_Provider_Call struct {
	*mock.Call
}

MockBucket_Provider_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Provider'

func (*MockBucket_Provider_Call) Return added in v1.13.0

func (*MockBucket_Provider_Call) Run added in v1.13.0

func (*MockBucket_Provider_Call) RunAndReturn added in v1.13.0

type MockBucket_ReaderAt_Call

type MockBucket_ReaderAt_Call struct {
	*mock.Call
}

MockBucket_ReaderAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReaderAt'

func (*MockBucket_ReaderAt_Call) Return

func (*MockBucket_ReaderAt_Call) Run

func (_c *MockBucket_ReaderAt_Call) Run(run func(ctx context.Context, filename string)) *MockBucket_ReaderAt_Call

func (*MockBucket_ReaderAt_Call) RunAndReturn

type MockBucket_SupportedIterOptions_Call added in v1.13.0

type MockBucket_SupportedIterOptions_Call struct {
	*mock.Call
}

MockBucket_SupportedIterOptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SupportedIterOptions'

func (*MockBucket_SupportedIterOptions_Call) Return added in v1.13.0

func (*MockBucket_SupportedIterOptions_Call) Run added in v1.13.0

func (*MockBucket_SupportedIterOptions_Call) RunAndReturn added in v1.13.0

type MockBucket_Upload_Call

type MockBucket_Upload_Call struct {
	*mock.Call
}

MockBucket_Upload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Upload'

func (*MockBucket_Upload_Call) Return

func (*MockBucket_Upload_Call) Run

func (_c *MockBucket_Upload_Call) Run(run func(ctx context.Context, name string, r io.Reader)) *MockBucket_Upload_Call

func (*MockBucket_Upload_Call) RunAndReturn

Jump to

Keyboard shortcuts

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