mocks

package
v1.76.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lock

type Lock struct {
	mock.Mock
}

Lock is an autogenerated mock type for the Lock type

func NewLock

func NewLock(t interface {
	mock.TestingT
	Cleanup(func())
}) *Lock

NewLock creates a new instance of Lock. 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 (*Lock) Acquire

func (_mock *Lock) Acquire(resource string, ttl time.Duration) (bool, error)

Acquire provides a mock function for the type Lock

func (*Lock) EXPECT added in v1.69.0

func (_m *Lock) EXPECT() *Lock_Expecter

func (*Lock) Forfeit

func (_mock *Lock) Forfeit(resource string) (bool, error)

Forfeit provides a mock function for the type Lock

type Lock_Acquire_Call added in v1.69.0

type Lock_Acquire_Call struct {
	*mock.Call
}

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

func (*Lock_Acquire_Call) Return added in v1.69.0

func (_c *Lock_Acquire_Call) Return(acquired bool, err error) *Lock_Acquire_Call

func (*Lock_Acquire_Call) Run added in v1.69.0

func (_c *Lock_Acquire_Call) Run(run func(resource string, ttl time.Duration)) *Lock_Acquire_Call

func (*Lock_Acquire_Call) RunAndReturn added in v1.69.0

func (_c *Lock_Acquire_Call) RunAndReturn(run func(resource string, ttl time.Duration) (bool, error)) *Lock_Acquire_Call

type Lock_Expecter added in v1.69.0

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

func (*Lock_Expecter) Acquire added in v1.69.0

func (_e *Lock_Expecter) Acquire(resource interface{}, ttl interface{}) *Lock_Acquire_Call

Acquire is a helper method to define mock.On call

  • resource string
  • ttl time.Duration

func (*Lock_Expecter) Forfeit added in v1.69.0

func (_e *Lock_Expecter) Forfeit(resource interface{}) *Lock_Forfeit_Call

Forfeit is a helper method to define mock.On call

  • resource string

type Lock_Forfeit_Call added in v1.69.0

type Lock_Forfeit_Call struct {
	*mock.Call
}

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

func (*Lock_Forfeit_Call) Return added in v1.69.0

func (_c *Lock_Forfeit_Call) Return(forfeited bool, err error) *Lock_Forfeit_Call

func (*Lock_Forfeit_Call) Run added in v1.69.0

func (_c *Lock_Forfeit_Call) Run(run func(resource string)) *Lock_Forfeit_Call

func (*Lock_Forfeit_Call) RunAndReturn added in v1.69.0

func (_c *Lock_Forfeit_Call) RunAndReturn(run func(resource string) (bool, error)) *Lock_Forfeit_Call

Jump to

Keyboard shortcuts

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