aboutsummaryrefslogtreecommitdiff
path: root/nvdmirror/failsetcache.go
blob: b119a10f7f157cc12b90a4eaf9bc3b5d3330ce87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package nvdmirror

import (
  "fmt"
)

// Mock cache implementation that fails on Set().
type FailSetCache byte

// Get cache value.  Always returns not found.
func (me FailSetCache) Get(_ string) (map[string]string, bool) {
  return nil, false
}

// Set cache value (fails unconditionally).
func (me FailSetCache) Set(s string, _ map[string]string) error {
  return fmt.Errorf("set failed: %s", s)
}

// Delete value (always succeeds).
func (me FailSetCache) Delete(_ string) error {
  return nil
}

// Close cache.  Always succeeds
func (me FailSetCache) Close() error {
  return nil
}