cache

package
v0.0.0-...-8ebdd08 Latest Latest
Warning

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

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

Documentation

Overview

Package cache provides application and HTTP response cache.

Index

Constants

View Source
const PulpContentPathKey = "central-pulp-content-dir"

Variables

View Source
var NotFound = errors.New("not found in cache")

Functions

func NewNoOpCache

func NewNoOpCache() *noOpCache

func NewRedisCache

func NewRedisCache() *redisCache

Types

type Cache

type Cache interface {
	GetAccessList(ctx context.Context) (rbac.AccessList, error)
	SetAccessList(ctx context.Context, accessList rbac.AccessList) error

	GetPulpContentPath(ctx context.Context) (string, error)
	SetPulpContentPath(ctx context.Context, pulpContentPath string) error
}

func Initialize

func Initialize() Cache

type MockCache

type MockCache struct {
	mock.Mock
}

MockCache is an autogenerated mock type for the Cache type

func NewMockCache

func NewMockCache(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockCache

NewMockCache creates a new instance of MockCache. 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 (*MockCache) GetAccessList

func (_m *MockCache) GetAccessList(ctx context.Context) (rbac.AccessList, error)

GetAccessList provides a mock function with given fields: ctx

func (*MockCache) GetPulpContentPath

func (_m *MockCache) GetPulpContentPath(ctx context.Context) (string, error)

GetPulpContentPath provides a mock function with given fields: ctx

func (*MockCache) SetAccessList

func (_m *MockCache) SetAccessList(ctx context.Context, accessList rbac.AccessList) error

SetAccessList provides a mock function with given fields: ctx, accessList

func (*MockCache) SetPulpContentPath

func (_m *MockCache) SetPulpContentPath(ctx context.Context, pulpContentPath string) error

SetPulpContentPath provides a mock function with given fields: ctx, pulpContentPath

Jump to

Keyboard shortcuts

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