Documentation
¶
Index ¶
- Constants
- func HashPassword(password string) (string, error)
- func ValidatePassword(password string) error
- type Base
- type Category
- type Error
- type Health
- type PasswordResetToken
- type Permission
- type RefreshToken
- type Reminder
- type Role
- type Task
- type TaskAssignment
- type User
- type VersionInfo
- type Workspace
- type WorkspaceRole
Constants ¶
View Source
const ( StatusGreen = "green" StatusOrange = "orange" StatusRed = "red" )
Variables ¶
This section is empty.
Functions ¶
func HashPassword ¶
func ValidatePassword ¶
Types ¶
type Base ¶
type Error ¶
type Error struct { // The general error message // // required: true // // example: Unauthorized Error string `json:"error"` // The http error code // // required: true // // example: 401 ErrorCode int `json:"errorCode"` // The error description // // required: true // // example: You are not authorized to access this resource ErrorDescription string `json:"errorDescription"` }
Error Model
Error model is used to return error messages to the client.
swagger:model Error
type PasswordResetToken ¶
type Permission ¶
type RefreshToken ¶
type Task ¶
type Task struct { Base Title string Description string DueDate time.Time Status string Priority string CompletedAt time.Time CategoryID uuid.UUID `gorm:"type:uuid;not null;"` CreatorID uuid.UUID `gorm:"type:uuid;not null"` WorkspaceID uuid.UUID `gorm:"type:uuid;not null"` Creator User `gorm:"foreignKey:CreatorID;"` Category Category `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` Workspace Workspace `gorm:"foreignKey:WorkspaceID"` Reminders []Reminder `gorm:"foreignKey:TaskID"` Users []User `gorm:"many2many:user_tasks;"` }
type TaskAssignment ¶
type User ¶
type User struct { Base Email string `gorm:"uniqueIndex" json:"email"` PasswordHash string `json:"-"` PasswordLastChanged time.Time `json:"-"` Verified bool `gorm:"default:false" json:"verified"` FirstName string `json:"firstName"` LastName string `json:"lastName"` ProfileImage string `json:"profileImage"` LastLogin time.Time `json:"lastLogin"` RefreshTokens []RefreshToken `gorm:"foreignKey:UserID" json:"-"` PasswordResetTokens []PasswordResetToken `gorm:"foreignKey:UserID" json:"-"` OwnedWorkspaces []Workspace `gorm:"foreignKey:OwnerID" json:"ownedWorkspaces"` Tasks []Task `gorm:"many2many:user_tasks;"` Workspaces []Workspace `gorm:"many2many:workspace_members;"` UserRoleWorkspaces []WorkspaceRole `gorm:"foreignKey:UserID"` }
User Model
User model is used to store user information.
swagger:model User
func (*User) VerifyPassword ¶
type VersionInfo ¶
type Workspace ¶
type Workspace struct { Base Name string `gorm:"not null"` Description string OwnerID uuid.UUID `gorm:"type:uuid;not null;"` Owner User `gorm:"foreignKey:OwnerID;"` Roles []Role `gorm:"foreignKey:WorkspaceID;"` Tasks []Task `gorm:"foreignKey:WorkspaceID;"` Users []User `gorm:"many2many:workspace_members;"` }
Click to show internal directories.
Click to hide internal directories.