Documentation ¶
Overview ¶
Package cache provides application and HTTP response cache.
Index ¶
- Constants
- Variables
- func NewNoOpCache() *noOpCache
- func NewRedisCache() *redisCache
- type Cache
- type MockCache
- func (_m *MockCache) GetAccessList(ctx context.Context) (rbac.AccessList, error)
- func (_m *MockCache) GetPulpContentPath(ctx context.Context) (string, error)
- func (_m *MockCache) GetSubscriptionCheck(ctx context.Context) (*api.SubscriptionCheckResponse, error)
- func (_m *MockCache) SetAccessList(ctx context.Context, accessList rbac.AccessList) error
- func (_m *MockCache) SetPulpContentPath(ctx context.Context, pulpContentPath string) error
- func (_m *MockCache) SetSubscriptionCheck(ctx context.Context, response api.SubscriptionCheckResponse) error
Constants ¶
const PulpContentPathKey = "central-pulp-content-dir"
Variables ¶
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 GetSubscriptionCheck(ctx context.Context) (*api.SubscriptionCheckResponse, error) SetSubscriptionCheck(ctx context.Context, response api.SubscriptionCheckResponse) error }
func Initialize ¶
func Initialize() Cache
type MockCache ¶
MockCache is an autogenerated mock type for the Cache type
func NewMockCache ¶
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 ¶
GetAccessList provides a mock function with given fields: ctx
func (*MockCache) GetPulpContentPath ¶
GetPulpContentPath provides a mock function with given fields: ctx
func (*MockCache) GetSubscriptionCheck ¶
func (_m *MockCache) GetSubscriptionCheck(ctx context.Context) (*api.SubscriptionCheckResponse, error)
GetSubscriptionCheck provides a mock function with given fields: ctx
func (*MockCache) SetAccessList ¶
SetAccessList provides a mock function with given fields: ctx, accessList
func (*MockCache) SetPulpContentPath ¶
SetPulpContentPath provides a mock function with given fields: ctx, pulpContentPath
func (*MockCache) SetSubscriptionCheck ¶
func (_m *MockCache) SetSubscriptionCheck(ctx context.Context, response api.SubscriptionCheckResponse) error
SetSubscriptionCheck provides a mock function with given fields: ctx, response