rdb

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DialectSqlite3    = "sqlite3"
	DialectMysql      = "mysql"
	DialectPostgreSQL = "postgres"
)

Supported DB dialects.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alpine

type Alpine struct {
	Family string
}

Alpine is a struct for DBAccess

func NewAlpine

func NewAlpine() *Alpine

NewAlpine creates DBAccess

func (*Alpine) GetByPackName

func (o *Alpine) GetByPackName(driver *gorm.DB, osVer, packName, _ string) (defs []models.Definition, err error)

GetByPackName select definitions by packName

func (*Alpine) InsertOval

func (o *Alpine) InsertOval(root *models.Root, meta models.FetchMeta, driver *gorm.DB) error

InsertOval inserts Alpine secdb information as OVAL format

func (*Alpine) Name

func (o *Alpine) Name() string

Name return family name

type Amazon

type Amazon struct {
	Family string
}

Amazon is a struct for DBAccess

func NewAmazon

func NewAmazon() *Amazon

NewAmazon creates DBAccess

func (*Amazon) GetByPackName

func (o *Amazon) GetByPackName(driver *gorm.DB, osVer, packName, arch string) ([]models.Definition, error)

GetByPackName select definitions by packName

func (*Amazon) InsertOval

func (o *Amazon) InsertOval(root *models.Root, meta models.FetchMeta, driver *gorm.DB) error

InsertOval inserts Amazon ALAS information as OVAL format

func (*Amazon) Name

func (o *Amazon) Name() string

Name return family name

type Debian

type Debian struct {
	Family string
}

Debian is a struct of DBAccess

func NewDebian

func NewDebian() *Debian

NewDebian creates DBAccess

func (*Debian) GetByPackName

func (o *Debian) GetByPackName(driver *gorm.DB, osVer, packName, _ string) (defs []models.Definition, err error)

GetByPackName select definitions by packName

func (*Debian) InsertOval

func (o *Debian) InsertOval(root *models.Root, meta models.FetchMeta, driver *gorm.DB) error

InsertOval inserts Debian OVAL

func (*Debian) Name

func (o *Debian) Name() string

Name return family name

type Driver

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

Driver is Driver for RDB

func NewRDB

func NewRDB(family, dbType, dbpath string, debugSQL bool) (driver *Driver, locked bool, err error)

NewRDB return RDB driver

func (*Driver) CloseDB

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

CloseDB close Database

func (*Driver) CountDefs

func (d *Driver) CountDefs(osFamily, osVer string) (int, error)

CountDefs counts the number of definitions specified by args

func (*Driver) GetByPackName

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

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

func (*Driver) GetLastModified

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

GetLastModified get last modified time of OVAL in roots

func (*Driver) InsertFetchMeta

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

InsertFetchMeta inserts FetchMeta

func (*Driver) InsertOval

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

InsertOval inserts OVAL

func (*Driver) MigrateDB

func (d *Driver) MigrateDB() error

MigrateDB migrates Database

func (*Driver) Name

func (d *Driver) Name() string

Name is driver name

func (*Driver) NewOvalDB

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

NewOvalDB create a OvalDB client

func (*Driver) OpenDB

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

OpenDB opens Database

type Oracle

type Oracle struct {
	Family string
}

Oracle is a struct of DBAccess

func NewOracle

func NewOracle() *Oracle

NewOracle creates DBAccess

func (*Oracle) GetByPackName

func (o *Oracle) GetByPackName(driver *gorm.DB, osVer, packName, _ string) ([]models.Definition, error)

GetByPackName select definitions by packName

func (*Oracle) InsertOval

func (o *Oracle) InsertOval(root *models.Root, meta models.FetchMeta, driver *gorm.DB) error

InsertOval inserts Oracle OVAL

func (*Oracle) Name

func (o *Oracle) Name() string

Name return family name

type OvalDB

type OvalDB interface {
	Name() string
	GetByPackName(*gorm.DB, string, string, string) ([]models.Definition, error)
	InsertOval(*models.Root, models.FetchMeta, *gorm.DB) error
}

OvalDB is a interface of RedHat, Debian

type RedHat

type RedHat struct {
	Family string
}

RedHat is a struct for DBAccess

func NewRedHat

func NewRedHat() *RedHat

NewRedHat creates DBAccess

func (*RedHat) GetByPackName

func (o *RedHat) GetByPackName(driver *gorm.DB, osVer, packName, _ string) ([]models.Definition, error)

GetByPackName select definitions by packName

func (*RedHat) InsertOval

func (o *RedHat) InsertOval(root *models.Root, meta models.FetchMeta, driver *gorm.DB) error

InsertOval inserts RedHat OVAL

func (*RedHat) Name

func (o *RedHat) Name() string

Name return family name

type SUSE

type SUSE struct {
	Family string
}

SUSE is a struct of DBAccess

func NewSUSE

func NewSUSE(suseType string) *SUSE

NewSUSE creates DBAccess

func (*SUSE) GetByPackName

func (o *SUSE) GetByPackName(driver *gorm.DB, osVer, packName, _ string) ([]models.Definition, error)

GetByPackName select definitions by packName SUSE : OVAL is separate for each minor version. So select OVAL by major.minimor version. http: //ftp.suse.com/pub/projects/security/oval/

func (*SUSE) InsertOval

func (o *SUSE) InsertOval(root *models.Root, meta models.FetchMeta, driver *gorm.DB) error

InsertOval inserts SUSE OVAL

func (*SUSE) Name

func (o *SUSE) Name() string

Name return family name

type Ubuntu

type Ubuntu struct {
	Family string
}

Ubuntu is a struct for DBAccess

func NewUbuntu

func NewUbuntu() *Ubuntu

NewUbuntu creates DBAccess

func (*Ubuntu) GetByPackName

func (o *Ubuntu) GetByPackName(driver *gorm.DB, osVer, packName, _ string) (defs []models.Definition, err error)

GetByPackName select definitions by packName

func (*Ubuntu) InsertOval

func (o *Ubuntu) InsertOval(root *models.Root, meta models.FetchMeta, driver *gorm.DB) error

InsertOval inserts Ubuntu OVAL

func (*Ubuntu) Name

func (o *Ubuntu) Name() string

Name return family name

Jump to

Keyboard shortcuts

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