mocks

package
v2.0.0-...-5e8ce1c Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInMemoryRedis

func NewInMemoryRedis() (*redis.Client, func())

Types

type CacheCallCounts

type CacheCallCounts struct {
	ExternalSets    int
	ExternalGets    int
	ExternalDeletes int
}

type MockCacheOptions

type MockCacheOptions struct {
	RepoCacheExpiration     time.Duration
	RevisionCacheExpiration time.Duration
	ReadDelay               time.Duration
	WriteDelay              time.Duration
}

type MockCacheType

type MockCacheType int
const (
	MockCacheTypeRedis MockCacheType = iota
	MockCacheTypeInMem
)

type MockRepoCache

type MockRepoCache struct {
	mock.Mock
	RedisClient       *cacheutilmocks.MockCacheClient
	StopRedisCallback func()
}

func NewMockRepoCache

func NewMockRepoCache(cacheOpts *MockCacheOptions) *MockRepoCache

func (*MockRepoCache) AssertCacheCalledTimes

func (mockCache *MockRepoCache) AssertCacheCalledTimes(t *testing.T, calls *CacheCallCounts)

Checks that the cache was called the expected number of times

func (*MockRepoCache) ConfigureDefaultCallbacks

func (mockCache *MockRepoCache) ConfigureDefaultCallbacks()

Jump to

Keyboard shortcuts

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