models

package
v0.0.0-...-31c99b1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseDbConnection

func CloseDbConnection(db *sql.DB)

CloseDbConnection will end dialogue with the DB Recommanded to use at program's end

func ConnectToDB

func ConnectToDB(host string, dbname string, user string, password string, port int64)

ConnectToDB Set up connection to the postgres DB Will panic on error

func DeleteRemind

func DeleteRemind(ctx context.Context, remindID string, userID string) error

DeleteRemind handle request to delete a remind from the db

Types

type Remind

type Remind struct {
	RemindID int
	Content  string
	UserID   string
}

Remind type

func GetUserLastRemind

func GetUserLastRemind(userID string) (Remind, error)

GetUserLastRemind handle request to get the last reminder from the user

func GetUserReminds

func GetUserReminds(ctx context.Context, userID string) ([]Remind, error)

GetUserReminds handle request to get reminds from the db

func InsertRemind

func InsertRemind(userID string, content string) (Remind, error)

InsertRemind handle request to add a new remind to the db

Jump to

Keyboard shortcuts

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