ntfy-alertmanager/cache/disabled.go

26 lines
650 B
Go
Raw Normal View History

2023-07-12 19:13:09 +02:00
package cache
2024-11-09 14:13:33 +01:00
import "context"
2023-07-12 19:13:09 +02:00
// 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.
2024-11-09 14:13:33 +01:00
func (c *DisabledCache) Set(_ context.Context, _ string, _ string) error {
2023-07-12 19:13:09 +02:00
return nil
}
// Contains is an empty function to implement the interface.
2024-11-09 14:13:33 +01:00
func (c *DisabledCache) Contains(_ context.Context, _ string, _ string) (bool, error) {
2023-07-12 19:13:09 +02:00
return false, nil
}
// Cleanup is an empty function to implement the interface.
func (c *DisabledCache) Cleanup() {}