database

package
v0.0.0-...-127feb8 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

filepath: /internal/database/connection.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

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

func LoadToken(email string) (string, error)

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

func SaveEmailScanned(recipient string) error

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

func SaveEmailSent(recipient, subject string) error

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.

func SaveToken

func SaveToken(email, token string) error

SaveToken saves a new credential to the database Parameters:

  • email: The email of the credential
  • token: The token of the credential

It returns an error if the statement fails to prepare or execute.

Types

This section is empty.

Jump to

Keyboard shortcuts

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