Update documentation

This commit is contained in:
2024-11-28 21:53:03 +01:00
parent 51ed9e53a4
commit f5d616fe00
13 changed files with 53 additions and 205 deletions

View File

@@ -8,14 +8,17 @@ import (
var validate = validator.New()
// UserRole represents the role of a user in the system
type UserRole string
// User roles
const (
RoleAdmin UserRole = "admin"
RoleEditor UserRole = "editor"
RoleViewer UserRole = "viewer"
)
// User represents a user in the system
type User struct {
ID int `json:"id" validate:"required,min=1"`
Email string `json:"email" validate:"required,email"`
@@ -26,6 +29,7 @@ type User struct {
LastWorkspaceID int `json:"lastWorkspaceId"`
}
// Validate validates the user struct
func (u *User) Validate() error {
return validate.Struct(u)
}