24 lines
594 B
Go
24 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() {}
|