cache

package
v0.0.0-...-d67e381 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Code generated by MockGen. DO NOT EDIT. Source: cache.go

Generated by this command:

mockgen -source=cache.go -package=cache -destination=mock_cache.go

Package cache is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New[T comparable](expiration time.Duration) *cache[T]

New returns a new cache with the requested item expiration duration, which automatically removes expired items at the cleanup interval.

Types

type Cache

type Cache[T comparable] interface {
	DeleteExpired()
	Get(key T) (interface{}, bool)
	Set(key T, value interface{})
	StartCollecting(ctx context.Context, interval time.Duration)
	WaitForTermination()
}

type MockCache

type MockCache[T comparable] struct {
	// contains filtered or unexported fields
}

MockCache is a mock of Cache interface.

func NewMockCache

func NewMockCache[T comparable](ctrl *gomock.Controller) *MockCache[T]

NewMockCache creates a new mock instance.

func (*MockCache[T]) DeleteExpired

func (m *MockCache[T]) DeleteExpired()

DeleteExpired mocks base method.

func (*MockCache[T]) EXPECT

func (m *MockCache[T]) EXPECT() *MockCacheMockRecorder[T]

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockCache[T]) Get

func (m *MockCache[T]) Get(key T) (any, bool)

Get mocks base method.

func (*MockCache[T]) Set

func (m *MockCache[T]) Set(key T, value any)

Set mocks base method.

func (*MockCache[T]) StartCollecting

func (m *MockCache[T]) StartCollecting(ctx context.Context, interval time.Duration)

StartCollecting mocks base method.

func (*MockCache[T]) WaitForTermination

func (m *MockCache[T]) WaitForTermination()

WaitForTermination mocks base method.

type MockCacheMockRecorder

type MockCacheMockRecorder[T comparable] struct {
	// contains filtered or unexported fields
}

MockCacheMockRecorder is the mock recorder for MockCache.

func (*MockCacheMockRecorder[T]) DeleteExpired

func (mr *MockCacheMockRecorder[T]) DeleteExpired() *gomock.Call

DeleteExpired indicates an expected call of DeleteExpired.

func (*MockCacheMockRecorder[T]) Get

func (mr *MockCacheMockRecorder[T]) Get(key any) *gomock.Call

Get indicates an expected call of Get.

func (*MockCacheMockRecorder[T]) Set

func (mr *MockCacheMockRecorder[T]) Set(key, value any) *gomock.Call

Set indicates an expected call of Set.

func (*MockCacheMockRecorder[T]) StartCollecting

func (mr *MockCacheMockRecorder[T]) StartCollecting(ctx, interval any) *gomock.Call

StartCollecting indicates an expected call of StartCollecting.

func (*MockCacheMockRecorder[T]) WaitForTermination

func (mr *MockCacheMockRecorder[T]) WaitForTermination() *gomock.Call

WaitForTermination indicates an expected call of WaitForTermination.

Jump to

Keyboard shortcuts

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