Documentation ¶
Index ¶
- type Comment
- type CommentRepository
- type DetailedCommentResponse
- type DetailedTicketResponse
- type FormattedDate
- type NewCommentRequest
- type NewSessionRequest
- type NewTicketRequest
- type NewUserRequest
- type Session
- type SessionRepository
- type Team
- type TeamRepository
- type TeamRequest
- type TeamResponse
- type Ticket
- type TicketRepository
- type UpdateUserRequest
- type UpdateUserSQL
- type UpdateUserTeam
- type User
- type UserHash
- type UserRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comment ¶
type Comment struct { ID int `db:"id" json:"id"` TicketID int `db:"ticketID" json:"ticketID"` AuthorID int `db:"authorID" json:"authorID"` Content string `db:"content" json:"description"` Date FormattedDate `db:"cdate" json:"date"` }
type CommentRepository ¶
type DetailedCommentResponse ¶
type DetailedCommentResponse struct { ID int `db:"id" json:"id"` Content string `db:"content" json:"description"` Date FormattedDate `json:"date"` Author *User `json:"author"` }
type DetailedTicketResponse ¶
type DetailedTicketResponse struct { ID int `json:"id"` Title string `json:"title"` Status string `json:"status"` Description string `json:"description"` Date FormattedDate `json:"date"` Author User `json:"author"` Assigned *User `json:"assigned"` Team *TeamResponse `json:"team"` }
type FormattedDate ¶
func (FormattedDate) MarshalJSON ¶
func (s FormattedDate) MarshalJSON() ([]byte, error)
func (FormattedDate) UnmarshalJSON ¶
func (s FormattedDate) UnmarshalJSON(b []byte) error
type NewCommentRequest ¶
type NewSessionRequest ¶
type NewTicketRequest ¶
type NewUserRequest ¶
type NewUserRequest struct { Name string `json:"name" form:"name" binding:"required"` Email string `json:"email" form:"email" binding:"required"` Password string `json:"password" form:"password" binding:"required"` ConfirmPassword string `json:"confirm_pass" form:"confirm_pass" binding:"required"` }
type SessionRepository ¶
type Team ¶
type Team struct { ID int `db:"id" json:"id"` Name string `db:"name" json:"name"` Users []User `json:"users"` Date FormattedDate `db:"cdate" json:"date"` }
type TeamRepository ¶
type TeamRequest ¶
type TeamRequest struct {
Name string `db:"name" json:"name"`
}
type TeamResponse ¶
type TeamResponse struct { ID int `db:"id" json:"id"` Name string `db:"name" json:"name"` Users []User `json:"users"` }
func GenerateTeamResponse ¶
func GenerateTeamResponse(id int, name string, users []User) *TeamResponse
type Ticket ¶
type Ticket struct { ID int `db:"id" json:"id"` AuthorID int `db:"authorID" json:"authorID"` AssignedID *int `db:"assignedID" json:"assignedID"` AssignedTeamID *int `db:"assignedTeamID" json:"assignedTeamID"` Author *User `json:author` Assigned *User `json:assigned` Team *Team `json:Team` Title string `db:"title" json:"title"` Status string `db:"status" json:"status"` Description string `db:"description" json:"description"` Date FormattedDate `db:"cdate" json:"date"` }
type TicketRepository ¶
type UpdateUserRequest ¶
type UpdateUserRequest struct { Name string `json:"name" form:"name"` TeamID int32 `json:"team_id" form:"team_id"` Email string `json:"email" form:"email"` CurrentPassword string `json:"current_pass" form:"current_pass"` Password string `json:"password" form:"password"` ConfirmPassword string `json:"confirm_pass" form:"confirm_pass"` }
type UpdateUserSQL ¶
type UpdateUserSQL struct { ID int TeamID sql.NullInt32 Name sql.NullString Email sql.NullString Password sql.NullString }
type UpdateUserTeam ¶
type UpdateUserTeam struct {
TeamID int32 `json:"team_id" form:"team_id" binding:"required"`
}
type UserRepository ¶
type UserRepository interface { FindByID(ID int) (*[]User, error) CreateUser(request *NewUserRequest) (sql.Result, error) GetAllUsers() (*[]User, error) GetUsersByName(sUserName string) (*[]User, error) UsernameOrEmailExists(name, email string) bool UpdateByID(request *UpdateUserSQL) (sql.Result, error) UpdateTeam(userId int, teamId sql.NullInt32) (sql.Result, error) GetHashByID(ID int) (*UserHash, error) GetHashByEmail(email string) (*UserHash, error) }
Click to show internal directories.
Click to hide internal directories.