ntfy-alertmanager/cache/disabled.go

24 lines
594 B
Go
Raw Normal View History

2023-07-12 19:13:09 +02:00
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() {}