aboutsummaryrefslogtreecommitdiff
path: root/nvdmirror/failsetcache.go
diff options
context:
space:
mode:
Diffstat (limited to 'nvdmirror/failsetcache.go')
-rw-r--r--nvdmirror/failsetcache.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/nvdmirror/failsetcache.go b/nvdmirror/failsetcache.go
new file mode 100644
index 0000000..ed5679b
--- /dev/null
+++ b/nvdmirror/failsetcache.go
@@ -0,0 +1,25 @@
+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)
+}
+
+// Close cache. Always succeeds
+func (me FailSetCache) Close() error {
+ return nil
+}
+
+