db

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	Name() string
	NewOvalDB(string) error
	CloseDB() error
	GetByPackName(string, string, string) ([]models.Definition, error)
	GetByCveID(string, string) ([]models.Definition, error)
	InsertOval(*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

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

NewDB return DB accessor.

type RedisDriver

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

RedisDriver is Driver for Redis

func NewRedis

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

NewRedis return Redis driver

func (*RedisDriver) CloseDB

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

CloseDB close Database

func (*RedisDriver) CountDefs

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

CountDefs counts the number of definitions specified by args

func (*RedisDriver) GetByCveID

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

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

func (*RedisDriver) GetByPackName

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

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

func (*RedisDriver) GetLastModified

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

GetLastModified get last modified time of OVAL in roots

func (*RedisDriver) InsertFetchMeta

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

InsertFetchMeta inserts FetchMeta Redis do not use this.

func (*RedisDriver) InsertOval

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

InsertOval inserts OVAL

func (*RedisDriver) Name

func (d *RedisDriver) Name() string

Name is driver name

func (*RedisDriver) NewOvalDB

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

NewOvalDB create a OvalDB client

func (*RedisDriver) OpenDB

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

OpenDB opens Database

func (*RedisDriver) OvalDB

func (d *RedisDriver) OvalDB() string

OvalDB is OvalDB name

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL