mocks

package
v0.0.0-...-706d53e Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: Apache-2.0 Imports: 3 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]) EXPECT

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

func (*Cache[T]) Get

func (_m *Cache[T]) Get(ctx context.Context, key string) (*T, error)

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

func (*Cache[T]) Set

func (_m *Cache[T]) Set(ctx context.Context, key string, value T, opts ...cache.Option) error

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

type Cache_Expecter

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

func (*Cache_Expecter[T]) Get

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

Get is a helper method to define mock.On call

  • ctx context.Context
  • key string

func (*Cache_Expecter[T]) Set

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

Set is a helper method to define mock.On call

  • ctx context.Context
  • key string
  • value T
  • opts ...cache.Option

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 error) *Cache_Get_Call[T]

func (*Cache_Get_Call[T]) Run

func (_c *Cache_Get_Call[T]) Run(run func(ctx context.Context, key string)) *Cache_Get_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(_a0 error) *Cache_Set_Call[T]

func (*Cache_Set_Call[T]) Run

func (_c *Cache_Set_Call[T]) Run(run func(ctx context.Context, key string, value T, opts ...cache.Option)) *Cache_Set_Call[T]

Jump to

Keyboard shortcuts

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