sqldbrepo

package
v0.0.0-...-2f60b96 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SuperUser int = iota
	Admin
	User
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLDBRepo

type SQLDBRepo struct {
	Config *config.AppConfig
}
var (
	DBRepo *SQLDBRepo
)

func GetDatabaseConnection

func GetDatabaseConnection() *SQLDBRepo

func NewSQLDBRepo

func NewSQLDBRepo(ac *config.AppConfig) *SQLDBRepo

func (*SQLDBRepo) ActivateUser

func (sqdb *SQLDBRepo) ActivateUser(activationToken string, id int64) (*models.User, error)

func (*SQLDBRepo) DeleteUser

func (sqldb *SQLDBRepo) DeleteUser(id int64) error

func (*SQLDBRepo) GetFilteredUserRemindersByID

func (sqdb *SQLDBRepo) GetFilteredUserRemindersByID(id int64, limit, offset int) ([]*models.Reminder, error)

func (*SQLDBRepo) GetUserByEmail

func (sqdb *SQLDBRepo) GetUserByEmail(email string) (*models.User, error)

func (*SQLDBRepo) GetUserById

func (sqdb *SQLDBRepo) GetUserById(id int64) (*models.User, error)

func (*SQLDBRepo) GetUserRemindersByID

func (sqdb *SQLDBRepo) GetUserRemindersByID(id int64) ([]*models.Reminder, error)

func (*SQLDBRepo) InsertReminder

func (sqdb *SQLDBRepo) InsertReminder(r *models.Reminder) (*int64, error)

func (*SQLDBRepo) InsertUser

func (sqdb *SQLDBRepo) InsertUser(u *models.User) (int64, error)

InsertUser accepts a pointer declaration to a user, and inserts it into the database. It will return the User ID, and an error if there are any

func (*SQLDBRepo) NewDatabaseConn

func (sqdb *SQLDBRepo) NewDatabaseConn() (*sql.DB, error)

func (*SQLDBRepo) ProcessAllReminders

func (sqdb *SQLDBRepo) ProcessAllReminders() ([]models.Reminder, error)

func (*SQLDBRepo) ProcessRemindersForUser

func (sqdb *SQLDBRepo) ProcessRemindersForUser(id int64) ([]models.Reminder, error)

func (*SQLDBRepo) SendNotification

func (sqdb *SQLDBRepo) SendNotification(dueDate time.Time, title, content string) error

func (*SQLDBRepo) UpdateUser

func (sqdb *SQLDBRepo) UpdateUser(u *models.User) (int, error)

Jump to

Keyboard shortcuts

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