Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
Database represents a wrapper around the GORM database connection.
func InitDB ¶
InitDB initializes and returns a new Database instance.
It takes a configuration object and uses it to establish a connection to the PostgreSQL database. It also performs auto-migration of the database schema for the Repository, WorkflowRun, and Statistics models.
Parameters:
- cfg: A pointer to a config.Config struct containing database connection details.
Returns:
- A pointer to a Database struct containing the initialized GORM DB connection.
- An error if the database connection or auto-migration fails.
func (*Database) GetMonitoredRepositories ¶
func (db *Database) GetMonitoredRepositories() ([]models.Repository, error)
func (*Database) SaveStatistics ¶
func (db *Database) SaveStatistics(stats *models.Statistics) error
func (*Database) SaveWorkflowRun ¶
func (db *Database) SaveWorkflowRun(run *github.WorkflowRun) error
Click to show internal directories.
Click to hide internal directories.