Fix the changelog cache logic for ubuntu/debian

This commit is contained in:
Kota Kanbe
2017-01-28 03:57:21 +09:00
parent 6084c1b1d3
commit 42a6004c7d
5 changed files with 76 additions and 39 deletions

10
cache/db.go vendored
View File

@@ -18,6 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package cache
import (
"time"
"github.com/future-architect/vuls/config"
"github.com/future-architect/vuls/models"
)
@@ -31,6 +33,7 @@ const metabucket = "changelog-meta"
type Cache interface {
Close() error
GetMeta(string) (Meta, bool, error)
RefreshMeta(Meta) error
EnsureBuckets(Meta) error
PrettyPrint(Meta) error
GetChangelog(string, string) (string, error)
@@ -40,9 +43,10 @@ type Cache interface {
// Meta holds a server name, distro information of the scanned server and
// package information that was collected at the last scan.
type Meta struct {
Name string
Distro config.Distro
Packs []models.PackageInfo
Name string
Distro config.Distro
Packs []models.PackageInfo
CreatedAt time.Time
}
// FindPack search a PackageInfo