database

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(db *sql.DB, entry *results.Entry)

Add checks if an entry is already in the database and if found updates the entry, else it adds the entry.

func Delete

func Delete(db *sql.DB, id string) error

Delete removes an entry from the database.

func DeleteDep

func DeleteDep(db *sql.DB, id string, dep string)

DeleteDep removes a dependency, package relationship from the database.

func Get

func Get(db *sql.DB, id string) (*results.Entry, error)

Get finds and returns an entry from the database.

func GetAll

func GetAll(db *sql.DB, output chan *results.Entry)

GetAll opens a channel and reads each entry into the channel.

func GetDeps

func GetDeps(db *sql.DB, id string) (result map[string]string, found bool)

GetDeps returns a map of all a packages dependent packages.

func ImportDeps

func ImportDeps(db *sql.DB, id string, new []string)

ImportDeps maps an app's dependencies to the app. Unlike AddDep this will also remove old dependencies. This was we can keep track of package relationships.

func Insert

func Insert(db *sql.DB, entry *results.Entry)

Insert adds a new entry into the database.

func InsertDep

func InsertDep(db *sql.DB, id string, dep string)

InsertDep adds a dependency, package relationship to the database.

func Open

func Open(databaseName string) (db *sql.DB)

Open opens a database and creates one if not found.

func Update

func Update(tx *sql.Tx, entry *results.Entry)

Update patches an existing db entry with new data.

Types

This section is empty.

Jump to

Keyboard shortcuts

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