Documentation ¶
Index ¶
- func CreateLink(db *database.DB, link *models.LinkForm) (newLink models.Link, err error)
- func CreateUser(db *db.DB, user *models.User) error
- func DeleteUser(db *db.DB, id string) error
- func GetAllLinks(db *database.DB, page, limit string) (links []models.Link, err error)
- func GetLinkFromID(db *database.DB, id string) (link *models.Link, err error)
- func GetUser(db *db.DB, id string) (user models.User, err error)
- func ListAllUsers(db *db.DB) ([]models.User, error)
- func Login(db *db.DB, username, password string) (user models.User, err error)
- func UpdateUser(db *db.DB, id string, userForm *models.UserForm) (user models.User, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateLink ¶
CreateLink adds a shortened URL in database.
func CreateUser ¶
CreateUser adds user in database.
func DeleteUser ¶
DeleteUser deletes a user from database.
func GetAllLinks ¶
func GetLinkFromID ¶
GetLinkFromID returns a link if ID exists, else returns an error.
func ListAllUsers ¶
ListAllUsers gets all users in database.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.