storage

package
v0.0.0-...-e4f51fb Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnectionPool

func NewConnectionPool(dbfile string) (*sql.DB, error)

NewConnectionPool opens a connection to the SQLite database, and returns a connection pool or an error;

Types

type DB

type DB struct {
	Pool *sql.DB
}

DB holds the connecton pool. Using this struct it's possible to query the db without the need of reautentication every time.

func NewDb

func NewDb(pool *sql.DB) *DB

NewDb creates a new Db instance.

func (DB) DeleteHost

func (d DB) DeleteHost(addr string) bool

func (DB) GetHostInfo

func (d DB) GetHostInfo(addr string) (nparse.Host, error)

func (DB) GetHosts

func (d DB) GetHosts() ([]host, error)

GetHosts queries the `host` table and returns a list of Host (which is different than nparse.Host, and it just holds the hosts' ids and ipv4 addresses).

func (DB) InsertHosts

func (d DB) InsertHosts(n *nparse.NmapScan) error

InsertHosts inserts a new host in the database.

Jump to

Keyboard shortcuts

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