vuls: Index | Files

package cache

import ""


Package Files

bolt.go db.go

func SetupBolt Uses

func SetupBolt(path string, l *logrus.Entry) error

SetupBolt opens a boltdb and creates a meta bucket if not exists.

type Bolt Uses

type Bolt struct {
    Path string
    Log  *logrus.Entry
    // contains filtered or unexported fields

Bolt holds a pointer of bolt.DB boltdb is used to store a cache of Changelogs of Ubuntu/Debian

func (Bolt) Close Uses

func (b Bolt) Close() error

Close a db.

func (Bolt) EnsureBuckets Uses

func (b Bolt) EnsureBuckets(meta Meta) error

EnsureBuckets puts a Meta information and create a buket that holds changelogs.

func (Bolt) GetChangelog Uses

func (b Bolt) GetChangelog(servername, packName string) (changelog string, err error)

GetChangelog get the changelgo of specified packName from the Bucket

func (Bolt) GetMeta Uses

func (b Bolt) GetMeta(serverName string) (meta Meta, found bool, err error)

GetMeta gets a Meta Information os the servername to boltdb.

func (Bolt) PrettyPrint Uses

func (b Bolt) PrettyPrint(meta Meta) error

PrettyPrint is for debug

func (Bolt) PutChangelog Uses

func (b Bolt) PutChangelog(servername, packName, changelog string) error

PutChangelog put the changelgo of specified packName into the Bucket

func (Bolt) RefreshMeta Uses

func (b Bolt) RefreshMeta(meta Meta) error

RefreshMeta gets a Meta Information os the servername to boltdb.

type Cache Uses

type Cache interface {
    Close() error
    GetMeta(string) (Meta, bool, error)
    RefreshMeta(Meta) error
    EnsureBuckets(Meta) error
    PrettyPrint(Meta) error
    GetChangelog(string, string) (string, error)
    PutChangelog(string, string, string) error

Cache is a interface of cache

var DB Cache

DB has a cache instance

type Meta Uses

type Meta struct {
    Name      string
    Distro    config.Distro
    Packs     models.Packages
    CreatedAt time.Time

Meta holds a server name, distro information of the scanned server and package information that was collected at the last scan.

Package cache imports 8 packages (graph) and is imported by 10 packages. Updated 2019-10-15. Refresh now. Tools for package owners.