Documentation
¶
Overview ¶
filepath: /internal/database/connection.go
Index ¶
- func Close() error
- func Initialize() error
- func LoadConfig() models.ConfigData
- func LoadDashboardData() models.DashboardData
- func LoadToken(email string) (string, error)
- func SaveConfig(config models.ConfigData) error
- func SaveEmailScanned(recipient string) error
- func SaveEmailSent(recipient, subject string) error
- func SaveToken(email, token string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Initialize ¶
func Initialize() error
InitializeDatabase initializes the database It returns an error if the database fails to initialize.
func LoadConfig ¶
func LoadConfig() models.ConfigData
LoadConfig fetches the current configuration from the database It returns a ConfigData struct containing the configuration values.
func LoadDashboardData ¶
func LoadDashboardData() models.DashboardData
LoadDashboardData fetches metrics from the database It returns a DashboardData struct containing the metrics.
func LoadToken ¶
LoadToken fetches the token from the database Parameters:
- email: The email of the credential
It returns the token of the credential.
func SaveConfig ¶
func SaveConfig(config models.ConfigData) error
SaveConfig saves the current configuration to the database Parameters:
- config: The configuration to save
It returns an error if the statement fails to prepare or execute.
func SaveEmailScanned ¶
SaveEmailScanned saves an email to the database Parameters:
- recipient: The recipient of the email
It returns an error if the statement fails to prepare or execute.
func SaveEmailSent ¶
SaveEmailSent saves an email to the database Parameters:
- recipient: The recipient of the email
- subject: The subject of the email
It returns an error if the statement fails to prepare or execute.
Types ¶
This section is empty.