ntfy-alertmanager/cache/disabled.go
2023-07-12 19:13:47 +02:00

23 lines
594 B
Go

package cache
// 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(_ string, _ string) error {
return nil
}
// Contains is an empty function to implement the interface.
func (c *DisabledCache) Contains(_ string, _ string) (bool, error) {
return false, nil
}
// Cleanup is an empty function to implement the interface.
func (c *DisabledCache) Cleanup() {}