controllers

package
v0.0.0-...-d3e0ec2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMessage

func AddMessage(db *gorm.DB, message *models.Message, userId uint) (interface{}, hermesErrors.HermesError)

AddMessage add a new message and check all word play types

func AddUser

func AddUser(db *gorm.DB, config *models.Config, userLogin *models.UserLogin) (*models.JWT, hermesErrors.HermesError)

AddUser add user new user and return a new jwt for the user

func DeleteMessage

func DeleteMessage(db *gorm.DB, messageId int, userId uint) (fiber.Map, hermesErrors.HermesError)

DeleteMessage delete a message by id

func EditMessage

func EditMessage(db *gorm.DB, updateMessage func(out interface{}) error, messageId int, userId uint) (*models.Message, hermesErrors.HermesError)

EditMessage update message with user input only if the message is owned by the user

func GetMessage

func GetMessage(db *gorm.DB, messageId int, userId uint) (*models.Message, hermesErrors.HermesError)

GetMessage get a messages owned by user

func GetMessages

func GetMessages(db *gorm.DB, userId uint) (fiber.Map, hermesErrors.HermesError)

GetMessages get all messages owned by or sent to the user

func Login

func Login(db *gorm.DB, config *models.Config, userLogin *models.UserLogin) (*models.JWT, hermesErrors.HermesError)

Login check password and get jwt for an existing user

Types

This section is empty.

Jump to

Keyboard shortcuts

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