mocks

package
v0.68.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache[T interface{}] struct {
	mock.Mock
}

Cache is an autogenerated mock type for the Cache type

func NewCache

func NewCache[T interface{}](t interface {
	mock.TestingT
	Cleanup(func())
}) *Cache[T]

NewCache creates a new instance of Cache. 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 (*Cache[T]) Contains

func (_m *Cache[T]) Contains(key string) bool

Contains provides a mock function with given fields: key

func (*Cache[T]) Delete added in v0.26.4

func (_m *Cache[T]) Delete(key string) bool

Delete provides a mock function with given fields: key

func (*Cache[T]) EXPECT

func (_m *Cache[T]) EXPECT() *Cache_Expecter[T]

func (*Cache[T]) Expire

func (_m *Cache[T]) Expire(key string) bool

Expire provides a mock function with given fields: key

func (*Cache[T]) Get

func (_m *Cache[T]) Get(key string) (T, bool)

Get provides a mock function with given fields: key

func (*Cache[T]) Mutate added in v0.26.2

func (_m *Cache[T]) Mutate(key string, mutate func(*T) T) T

Mutate provides a mock function with given fields: key, mutate

func (*Cache[T]) MutateX added in v0.26.2

func (_m *Cache[T]) MutateX(key string, mutate func(*T) T, ttl time.Duration) T

MutateX provides a mock function with given fields: key, mutate, ttl

func (*Cache[T]) Provide

func (_m *Cache[T]) Provide(key string, provider func() T) T

Provide provides a mock function with given fields: key, provider

func (*Cache[T]) ProvideWithError

func (_m *Cache[T]) ProvideWithError(key string, provider func() (T, error)) (T, error)

ProvideWithError provides a mock function with given fields: key, provider

func (*Cache[T]) Set

func (_m *Cache[T]) Set(key string, value T)

Set provides a mock function with given fields: key, value

func (*Cache[T]) SetX

func (_m *Cache[T]) SetX(key string, value T, ttl time.Duration)

SetX provides a mock function with given fields: key, value, ttl

func (*Cache[T]) Stop added in v0.39.1

func (_m *Cache[T]) Stop()

Stop provides a mock function with no fields

type Cache_Contains_Call

type Cache_Contains_Call[T interface{}] struct {
	*mock.Call
}

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

func (*Cache_Contains_Call[T]) Return

func (_c *Cache_Contains_Call[T]) Return(_a0 bool) *Cache_Contains_Call[T]

func (*Cache_Contains_Call[T]) Run

func (_c *Cache_Contains_Call[T]) Run(run func(key string)) *Cache_Contains_Call[T]

func (*Cache_Contains_Call[T]) RunAndReturn

func (_c *Cache_Contains_Call[T]) RunAndReturn(run func(string) bool) *Cache_Contains_Call[T]

type Cache_Delete_Call added in v0.26.4

type Cache_Delete_Call[T interface{}] struct {
	*mock.Call
}

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

func (*Cache_Delete_Call[T]) Return added in v0.26.4

func (_c *Cache_Delete_Call[T]) Return(_a0 bool) *Cache_Delete_Call[T]

func (*Cache_Delete_Call[T]) Run added in v0.26.4

func (_c *Cache_Delete_Call[T]) Run(run func(key string)) *Cache_Delete_Call[T]

func (*Cache_Delete_Call[T]) RunAndReturn added in v0.26.4

func (_c *Cache_Delete_Call[T]) RunAndReturn(run func(string) bool) *Cache_Delete_Call[T]

type Cache_Expecter

type Cache_Expecter[T interface{}] struct {
	// contains filtered or unexported fields
}

func (*Cache_Expecter[T]) Contains

func (_e *Cache_Expecter[T]) Contains(key interface{}) *Cache_Contains_Call[T]

Contains is a helper method to define mock.On call

  • key string

func (*Cache_Expecter[T]) Delete added in v0.26.4

func (_e *Cache_Expecter[T]) Delete(key interface{}) *Cache_Delete_Call[T]

Delete is a helper method to define mock.On call

  • key string

func (*Cache_Expecter[T]) Expire

func (_e *Cache_Expecter[T]) Expire(key interface{}) *Cache_Expire_Call[T]

Expire is a helper method to define mock.On call

  • key string

func (*Cache_Expecter[T]) Get

func (_e *Cache_Expecter[T]) Get(key interface{}) *Cache_Get_Call[T]

Get is a helper method to define mock.On call

  • key string

func (*Cache_Expecter[T]) Mutate added in v0.26.2

func (_e *Cache_Expecter[T]) Mutate(key interface{}, mutate interface{}) *Cache_Mutate_Call[T]

Mutate is a helper method to define mock.On call

  • key string
  • mutate func(*T) T

func (*Cache_Expecter[T]) MutateX added in v0.26.2

func (_e *Cache_Expecter[T]) MutateX(key interface{}, mutate interface{}, ttl interface{}) *Cache_MutateX_Call[T]

MutateX is a helper method to define mock.On call

  • key string
  • mutate func(*T) T
  • ttl time.Duration

func (*Cache_Expecter[T]) Provide

func (_e *Cache_Expecter[T]) Provide(key interface{}, provider interface{}) *Cache_Provide_Call[T]

Provide is a helper method to define mock.On call

  • key string
  • provider func() T

func (*Cache_Expecter[T]) ProvideWithError

func (_e *Cache_Expecter[T]) ProvideWithError(key interface{}, provider interface{}) *Cache_ProvideWithError_Call[T]

ProvideWithError is a helper method to define mock.On call

  • key string
  • provider func()(T , error)

func (*Cache_Expecter[T]) Set

func (_e *Cache_Expecter[T]) Set(key interface{}, value interface{}) *Cache_Set_Call[T]

Set is a helper method to define mock.On call

  • key string
  • value T

func (*Cache_Expecter[T]) SetX

func (_e *Cache_Expecter[T]) SetX(key interface{}, value interface{}, ttl interface{}) *Cache_SetX_Call[T]

SetX is a helper method to define mock.On call

  • key string
  • value T
  • ttl time.Duration

func (*Cache_Expecter[T]) Stop added in v0.39.1

func (_e *Cache_Expecter[T]) Stop() *Cache_Stop_Call[T]

Stop is a helper method to define mock.On call

type Cache_Expire_Call

type Cache_Expire_Call[T interface{}] struct {
	*mock.Call
}

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

func (*Cache_Expire_Call[T]) Return

func (_c *Cache_Expire_Call[T]) Return(_a0 bool) *Cache_Expire_Call[T]

func (*Cache_Expire_Call[T]) Run

func (_c *Cache_Expire_Call[T]) Run(run func(key string)) *Cache_Expire_Call[T]

func (*Cache_Expire_Call[T]) RunAndReturn

func (_c *Cache_Expire_Call[T]) RunAndReturn(run func(string) bool) *Cache_Expire_Call[T]

type Cache_Get_Call

type Cache_Get_Call[T interface{}] struct {
	*mock.Call
}

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

func (*Cache_Get_Call[T]) Return

func (_c *Cache_Get_Call[T]) Return(_a0 T, _a1 bool) *Cache_Get_Call[T]

func (*Cache_Get_Call[T]) Run

func (_c *Cache_Get_Call[T]) Run(run func(key string)) *Cache_Get_Call[T]

func (*Cache_Get_Call[T]) RunAndReturn

func (_c *Cache_Get_Call[T]) RunAndReturn(run func(string) (T, bool)) *Cache_Get_Call[T]

type Cache_MutateX_Call added in v0.26.2

type Cache_MutateX_Call[T interface{}] struct {
	*mock.Call
}

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

func (*Cache_MutateX_Call[T]) Return added in v0.26.2

func (_c *Cache_MutateX_Call[T]) Return(_a0 T) *Cache_MutateX_Call[T]

func (*Cache_MutateX_Call[T]) Run added in v0.26.2

func (_c *Cache_MutateX_Call[T]) Run(run func(key string, mutate func(*T) T, ttl time.Duration)) *Cache_MutateX_Call[T]

func (*Cache_MutateX_Call[T]) RunAndReturn added in v0.26.2

func (_c *Cache_MutateX_Call[T]) RunAndReturn(run func(string, func(*T) T, time.Duration) T) *Cache_MutateX_Call[T]

type Cache_Mutate_Call added in v0.26.2

type Cache_Mutate_Call[T interface{}] struct {
	*mock.Call
}

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

func (*Cache_Mutate_Call[T]) Return added in v0.26.2

func (_c *Cache_Mutate_Call[T]) Return(_a0 T) *Cache_Mutate_Call[T]

func (*Cache_Mutate_Call[T]) Run added in v0.26.2

func (_c *Cache_Mutate_Call[T]) Run(run func(key string, mutate func(*T) T)) *Cache_Mutate_Call[T]

func (*Cache_Mutate_Call[T]) RunAndReturn added in v0.26.2

func (_c *Cache_Mutate_Call[T]) RunAndReturn(run func(string, func(*T) T) T) *Cache_Mutate_Call[T]

type Cache_ProvideWithError_Call

type Cache_ProvideWithError_Call[T interface{}] struct {
	*mock.Call
}

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

func (*Cache_ProvideWithError_Call[T]) Return

func (_c *Cache_ProvideWithError_Call[T]) Return(_a0 T, _a1 error) *Cache_ProvideWithError_Call[T]

func (*Cache_ProvideWithError_Call[T]) Run

func (_c *Cache_ProvideWithError_Call[T]) Run(run func(key string, provider func() (T, error))) *Cache_ProvideWithError_Call[T]

func (*Cache_ProvideWithError_Call[T]) RunAndReturn

func (_c *Cache_ProvideWithError_Call[T]) RunAndReturn(run func(string, func() (T, error)) (T, error)) *Cache_ProvideWithError_Call[T]

type Cache_Provide_Call

type Cache_Provide_Call[T interface{}] struct {
	*mock.Call
}

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

func (*Cache_Provide_Call[T]) Return

func (_c *Cache_Provide_Call[T]) Return(_a0 T) *Cache_Provide_Call[T]

func (*Cache_Provide_Call[T]) Run

func (_c *Cache_Provide_Call[T]) Run(run func(key string, provider func() T)) *Cache_Provide_Call[T]

func (*Cache_Provide_Call[T]) RunAndReturn

func (_c *Cache_Provide_Call[T]) RunAndReturn(run func(string, func() T) T) *Cache_Provide_Call[T]

type Cache_SetX_Call

type Cache_SetX_Call[T interface{}] struct {
	*mock.Call
}

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

func (*Cache_SetX_Call[T]) Return

func (_c *Cache_SetX_Call[T]) Return() *Cache_SetX_Call[T]

func (*Cache_SetX_Call[T]) Run

func (_c *Cache_SetX_Call[T]) Run(run func(key string, value T, ttl time.Duration)) *Cache_SetX_Call[T]

func (*Cache_SetX_Call[T]) RunAndReturn

func (_c *Cache_SetX_Call[T]) RunAndReturn(run func(string, T, time.Duration)) *Cache_SetX_Call[T]

type Cache_Set_Call

type Cache_Set_Call[T interface{}] struct {
	*mock.Call
}

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

func (*Cache_Set_Call[T]) Return

func (_c *Cache_Set_Call[T]) Return() *Cache_Set_Call[T]

func (*Cache_Set_Call[T]) Run

func (_c *Cache_Set_Call[T]) Run(run func(key string, value T)) *Cache_Set_Call[T]

func (*Cache_Set_Call[T]) RunAndReturn

func (_c *Cache_Set_Call[T]) RunAndReturn(run func(string, T)) *Cache_Set_Call[T]

type Cache_Stop_Call added in v0.39.1

type Cache_Stop_Call[T interface{}] struct {
	*mock.Call
}

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

func (*Cache_Stop_Call[T]) Return added in v0.39.1

func (_c *Cache_Stop_Call[T]) Return() *Cache_Stop_Call[T]

func (*Cache_Stop_Call[T]) Run added in v0.39.1

func (_c *Cache_Stop_Call[T]) Run(run func()) *Cache_Stop_Call[T]

func (*Cache_Stop_Call[T]) RunAndReturn added in v0.39.1

func (_c *Cache_Stop_Call[T]) RunAndReturn(run func()) *Cache_Stop_Call[T]

Jump to

Keyboard shortcuts

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