db

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: MIT Imports: 13 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
	OpenDB(dbType, dbPath string, debugSQL bool) (bool, error)
	MigrateDB() error
	GetExploitByID(string) []*models.Exploit
	GetExploitByCveID(string) []*models.Exploit
	GetExploitMultiByCveID([]string) map[string][]*models.Exploit
	InsertExploit([]*models.Exploit) error
	GetExploitAll() []*models.Exploit
}

DB :

func NewDB

func NewDB(dbType string, dbPath string, debugSQL bool) (driver DB, locked bool, err error)

NewDB :

type RDBDriver

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

RDBDriver :

func (*RDBDriver) GetExploitAll

func (r *RDBDriver) GetExploitAll() []*models.Exploit

GetExploitAll :

func (*RDBDriver) GetExploitByCveID

func (r *RDBDriver) GetExploitByCveID(cveID string) []*models.Exploit

GetExploitByCveID :

func (*RDBDriver) GetExploitByID

func (r *RDBDriver) GetExploitByID(exploitUniqueID string) []*models.Exploit

GetExploitByID :

func (*RDBDriver) GetExploitMultiByCveID

func (r *RDBDriver) GetExploitMultiByCveID(cveIDs []string) (exploits map[string][]*models.Exploit)

GetExploitMultiByCveID :

func (*RDBDriver) GetExploitMultiByID

func (r *RDBDriver) GetExploitMultiByID(exploitUniqueIDs []string) map[string][]*models.Exploit

GetExploitMultiByID :

func (*RDBDriver) InsertExploit

func (r *RDBDriver) InsertExploit(exploits []*models.Exploit) (err error)

InsertExploit :

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

type RedisDriver

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

RedisDriver is Driver for Redis

func (*RedisDriver) GetExploitAll

func (r *RedisDriver) GetExploitAll() (exploits []*models.Exploit)

GetExploitAll :

func (*RedisDriver) GetExploitByCveID

func (r *RedisDriver) GetExploitByCveID(cveID string) (exploits []*models.Exploit)

GetExploitByCveID :

func (*RedisDriver) GetExploitByID

func (r *RedisDriver) GetExploitByID(exploitDBID string) (exploits []*models.Exploit)

GetExploitByID :

func (*RedisDriver) GetExploitMultiByCveID

func (r *RedisDriver) GetExploitMultiByCveID(cveIDs []string) (exploitsMap map[string][]*models.Exploit)

GetExploitMultiByCveID :

func (*RedisDriver) InsertExploit

func (r *RedisDriver) InsertExploit(exploits []*models.Exploit) (err error)

InsertExploit :

func (*RedisDriver) MigrateDB

func (r *RedisDriver) MigrateDB() error

MigrateDB migrates Database

func (*RedisDriver) Name

func (r *RedisDriver) Name() string

Name return db name

func (*RedisDriver) OpenDB

func (r *RedisDriver) 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