mocks

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 2 Imported by: 0

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 mockConstructorTestingTNewCache) *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.

func (*Cache[T]) Contains

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

Contains 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]) 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

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_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]) 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]) 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

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_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]

Jump to

Keyboard shortcuts

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