goval-dictionary: github.com/kotakanbe/goval-dictionary/db Index | Files | Directories

package db

import "github.com/kotakanbe/goval-dictionary/db"

Index

Package Files

db.go redis.go

type DB Uses

type DB interface {
    Name() string
    NewOvalDB(string) error
    CloseDB() error
    GetByPackName(string, string, string, string) ([]models.Definition, error)
    InsertOval(string, *models.Root, models.FetchMeta) error
    InsertFetchMeta(models.FetchMeta) error
    CountDefs(string, string) (int, error)
    GetLastModified(string, string) time.Time
}

DB is interface for a database driver

func NewDB Uses

func NewDB(family, dbType, dbpath string, debugSQL bool) (db DB, locked bool, err error)

NewDB return DB accessor.

type RedisDriver Uses

type RedisDriver struct {
    // contains filtered or unexported fields
}

RedisDriver is Driver for Redis

func NewRedis Uses

func NewRedis(family, dbType, dbpath string, debugSQL bool) (driver *RedisDriver, locked bool, err error)

NewRedis return Redis driver

func (*RedisDriver) CloseDB Uses

func (d *RedisDriver) CloseDB() (err error)

CloseDB close Database

func (*RedisDriver) CountDefs Uses

func (d *RedisDriver) CountDefs(family, osVer string) (int, error)

CountDefs counts the number of definitions specified by args

func (*RedisDriver) GetByCveID Uses

func (d *RedisDriver) GetByCveID(family, osVer, cveID string) ([]models.Definition, error)

GetByCveID select OVAL definition related to OS Family, osVer, cveID

func (*RedisDriver) GetByPackName Uses

func (d *RedisDriver) GetByPackName(family, osVer, packName, arch string) (defs []models.Definition, err error)

GetByPackName select OVAL definition related to OS Family, osVer, packName, arch

func (*RedisDriver) GetLastModified Uses

func (d *RedisDriver) GetLastModified(osFamily, osVer string) time.Time

GetLastModified get last modified time of OVAL in roots

func (*RedisDriver) InsertFetchMeta Uses

func (d *RedisDriver) InsertFetchMeta(meta models.FetchMeta) error

InsertFetchMeta inserts FetchMeta Redis do not use this.

func (*RedisDriver) InsertOval Uses

func (d *RedisDriver) InsertOval(family string, root *models.Root, meta models.FetchMeta) (err error)

InsertOval inserts OVAL

func (*RedisDriver) Name Uses

func (d *RedisDriver) Name() string

Name is driver name

func (*RedisDriver) NewOvalDB Uses

func (d *RedisDriver) NewOvalDB(family string) error

NewOvalDB create a OvalDB client

func (*RedisDriver) OpenDB Uses

func (d *RedisDriver) OpenDB(dbType, dbPath string, debugSQL bool) (err error)

OpenDB opens Database

Directories

PathSynopsis
rdb

Package db imports 9 packages (graph) and is imported by 19 packages. Updated 2019-09-04. Refresh now. Tools for package owners.