ntfy-alertmanager/cache/disabled.go
2024-11-09 14:13:33 +01:00

25 lines
650 B
Go

package cache
import "context"
// DisabledCache is the disabled cache.
type DisabledCache struct{}
// NewDisabledCache creates a new disabled cache.
func NewDisabledCache() (Cache, error) {
c := new(DisabledCache)
return c, nil
}
// Set is an empty function to implement the interface.
func (c *DisabledCache) Set(_ context.Context, _ string, _ string) error {
return nil
}
// Contains is an empty function to implement the interface.
func (c *DisabledCache) Contains(_ context.Context, _ string, _ string) (bool, error) {
return false, nil
}
// Cleanup is an empty function to implement the interface.
func (c *DisabledCache) Cleanup() {}