db

package
v0.0.0-...-578d352 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Db *sql.DB

Functions

func CheckUserExists

func CheckUserExists(userId int64) (bool, error)

func CreateUser

func CreateUser(u *User) (int64, error)

func DeleteUser

func DeleteUser(userId int64) error

func InitDB

func InitDB(url string) error

func UpdateUser

func UpdateUser(u *User) error

Types

type User

type User struct {
	Id         int64  `json:"id"`
	Name       string `json:"name"`
	Email      string `json:"email"`
	ProfilePic string `json:"profilePic"`
}

func GetAllUsers

func GetAllUsers(limit int64, offset int64) ([]User, error)

func GetUser

func GetUser(userId int64) (*User, error)

Jump to

Keyboard shortcuts

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