postgres

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

File: connection.go

File: host_operations.go

File: vulnerability_operations.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHost

func AddHost(db *gorm.DB, host models.Host) error

func AddVulnerability

func AddVulnerability(db *gorm.DB, entry models.CVEData) error

func AutoMigrateSchema added in v0.0.19

func AutoMigrateSchema() error

AutoMigrateSchema runs GORM AutoMigrate for core models without dropping tables. Used by the ledger migrator baseline step and by SIRIUS_SCHEMA_AUTO_MIGRATE.

func AutoMigrateSchemaDB added in v0.0.19

func AutoMigrateSchemaDB(conn *gorm.DB) error

AutoMigrateSchemaDB runs GORM AutoMigrate against the provided connection.

func GetAllHosts

func GetAllHosts(db *gorm.DB) ([]models.Host, error)

func GetCVEID

func GetCVEID(db *gorm.DB, cve string) (uint, error)

func GetConnectionError added in v0.0.4

func GetConnectionError() error

GetConnectionError returns the last connection error

func GetDB

func GetDB() *gorm.DB

GetDB returns the database connection, initializing it if necessary

func GetHost

func GetHost(db *gorm.DB, ip string) (models.Host, error)

func GetVulnerability

func GetVulnerability(db *gorm.DB, cveID string) (models.CVEItem, error)

* GetVulnerability accepts a CVE ID and returns the corresponding CVEItem

func IsConnected added in v0.0.4

func IsConnected() bool

IsConnected returns whether the database is connected

Types

This section is empty.

Directories

Path Synopsis
File: event.go
File: event.go

Jump to

Keyboard shortcuts

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