db

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: Apache-2.0 Imports: 10 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
	CloseDB() error
	InsertCpes([]*models.CategorizedCpe) error
	GetByExactTitle(string) ([]models.CategorizedCpe, error)
	GetByLikeTitle(string) ([]models.CategorizedCpe, error)
}

DB is interface for a database driver

func NewDB

func NewDB(dbType, dbpath string, debugSQL bool) (DB, bool, error)

NewDB return DB accessor.

type RDBDriver

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

RDBDriver is Driver for RDB

func NewRDB

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

NewRDB return RDB driver

func (*RDBDriver) CloseDB

func (r *RDBDriver) CloseDB() (err error)

CloseDB close Database

func (*RDBDriver) GetByExactTitle

func (r *RDBDriver) GetByExactTitle(title string) ([]models.CategorizedCpe, error)

GetByExactTitle Returns the CPE strings which exactly matches the title string

func (*RDBDriver) GetByLikeTitle

func (r *RDBDriver) GetByLikeTitle(title string) ([]models.CategorizedCpe, error)

GetByLikeTitle Returns the CPE strings which matches the title as substring

func (*RDBDriver) InsertCpes

func (r *RDBDriver) InsertCpes(cpes []*models.CategorizedCpe) error

InsertCpes inserts Cpe Information into DB

func (*RDBDriver) MigrateDB

func (r *RDBDriver) MigrateDB() error

MigrateDB migrates Database

func (*RDBDriver) Name

func (r *RDBDriver) Name() string

Name return db name

func (*RDBDriver) OpenDB

func (r *RDBDriver) OpenDB(dbType, dbPath string, debugSQL bool) (locked bool, err error)

OpenDB opens Database

Jump to

Keyboard shortcuts

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