aboutsummaryrefslogtreecommitdiff
path: root/nvdmirror/cache.go
blob: d65b2c7ffdd937ddb4278778b3fb3484e8f13d49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package nvdmirror

import (
  "time"
)

// Cache entry
type Entry struct {
  // time that entry was set
  Time time.Time `json:"time"`
  Headers map[string]string `json:"headers"`
}

// URL cache
type Cache interface {
  Get(string) (map[string]string, bool)
  Set(string, map[string]string) error

  // delete cache entry 
  Delete(string) error
  Close() error // save and close cache file
}