1package noop
 2
 3import (
 4	"context"
 5
 6	"github.com/charmbracelet/soft-serve/server/cache"
 7)
 8
 9type noopCache struct{}
10
11// NewCache returns a new Cache.
12func NewCache(_ context.Context, _ ...cache.Option) (cache.Cache, error) {
13	return &noopCache{}, nil
14}
15
16// Contains implements Cache.
17func (*noopCache) Contains(_ context.Context, _ string) bool {
18	return false
19}
20
21// Delete implements Cache.
22func (*noopCache) Delete(_ context.Context, _ string) {}
23
24// Get implements Cache.
25func (*noopCache) Get(_ context.Context, _ string) (any, bool) {
26	return nil, false
27}
28
29// Keys implements Cache.
30func (*noopCache) Keys(_ context.Context) []string {
31	return []string{}
32}
33
34// Len implements Cache.
35func (*noopCache) Len(_ context.Context) int64 {
36	return -1
37}
38
39// Set implements Cache.
40func (*noopCache) Set(_ context.Context, _ string, _ any, _ ...cache.ItemOption) {}
41
42var _ cache.Cache = &noopCache{}