Documentation ¶
Index ¶
- Variables
- func ComparePasswords(password, hash string) bool
- func FindGroupFromURL(r *http.Request) (*db.Group, error)
- func FindIDFromURL(r *http.Request, value string) (int, error)
- func FindMessageFromURL(r *http.Request) (*db.Message, error)
- func FindRoomFromURL(r *http.Request) (*db.Room, error)
- func FindUserFromURL(r *http.Request) (*db.User, error)
- func GenerateSalt(n int) string
- func UpdateGroupInheritances(group *db.Group, inheritances []uint) (errorsList []utils.Error)
- func UpdateGroupRoomPermissions(group *db.Group, roomPermissions map[uint]uint) (errorsList []utils.Error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // InvalidType is an error returned if a parameter type is wrong (e.g: string instead of int) InvalidType = errors.New("invalid parameter type") // UnknownRoom is an error returned if the user requested for a room that doesn't exists UnknownRoom = errors.New("unknown room") // UnknownUser is an error returned if the user requested for an user that doesn't exists UnknownUser = errors.New("unknown user") // UnknownMessage is an error returned if the user requested for a room message that doesn't exists UnknownMessage = errors.New("unknown message") )
Functions ¶
func ComparePasswords ¶
ComparePasswords compares an input password with a hashed password (Argon2ID)
func FindGroupFromURL ¶
FindGroupFromURL parses request's URL and find the corresponding group thanks to the ID
func FindIDFromURL ¶
FindIDFromURL extracts a snowflake identifier from the URL, using mux variables
func FindMessageFromURL ¶
FindMessageFromURL parses request's URL and find the corresponding message thanks to the ID
func FindRoomFromURL ¶
FindRoomFromURL parses request's URL and find the corresponding room thanks to the ID
func FindUserFromURL ¶
FindRoomFromURL parses request's URL and find the corresponding user thanks to the ID
func GenerateSalt ¶
GenerateSalt generates a n-length salt for password generation
func UpdateGroupInheritances ¶
UpdateGroupInheritances updates inheritances of a group inside the database
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.