Documentation
¶
Index ¶
- func VerifyPassword(hashedPassword, password string) error
- type Group
- func (g *Group) DeleteGroup(db *gorm.DB, gid uint32) (int64, error)
- func (g *Group) FillFields()
- func (g *Group) FindAllGroups(db *gorm.DB) (*[]Group, error)
- func (g *Group) FindGroupById(db *gorm.DB, gid uint32) (*Group, error)
- func (g *Group) SaveGroup(db *gorm.DB) (*Group, error)
- func (g *Group) UpdateGroup(db *gorm.DB, gid uint32) (*Group, error)
- func (g *Group) Validate() error
- type IntersectionTestQuestion
- type JsonUser
- type Question
- func (q *Question) DeleteQuestion(db *gorm.DB, qid uint32) (int64, error)
- func (q *Question) FillFields()
- func (q *Question) FindAllQuestions(db *gorm.DB) (*[]Question, error)
- func (q *Question) FindQuestionById(db *gorm.DB, qid uint32) (*Question, error)
- func (q *Question) SaveQuestion(db *gorm.DB) (*Question, error)
- func (q *Question) UpdateQuestion(db *gorm.DB, qid uint32) (*Question, error)
- func (q *Question) Validate() error
- type Test
- func (t *Test) AddQuestionToTest(db *gorm.DB, tid uint32, qid uint32) (*IntersectionTestQuestion, error)
- func (t *Test) DeleteTest(db *gorm.DB, tid uint32) (int64, error)
- func (t *Test) FillFields()
- func (t *Test) FindAllTests(db *gorm.DB) (*[]Test, error)
- func (t *Test) FindTestById(db *gorm.DB, tid uint32) (*[]*Question, error)
- func (t *Test) SaveTest(db *gorm.DB) (*Test, error)
- func (t *Test) UpdateTest(db *gorm.DB, tid uint32) (*Test, error)
- func (t *Test) Validate() error
- type User
- func (u *User) DeleteUser(db *gorm.DB, uid uint32) (int64, error)
- func (u *User) FillFields()
- func (u *User) FindAllUsers(db *gorm.DB) (*[]User, error)
- func (u *User) FindUserById(db *gorm.DB, uid uint32) (*JsonUser, error)
- func (u *User) HashPassword() error
- func (u *User) SaveUser(db *gorm.DB) (*User, error)
- func (u *User) UpdateUser(db *gorm.DB, uid uint32) (*User, error)
- func (u *User) Validate(action string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VerifyPassword ¶
Types ¶
type Group ¶
type Group struct { ID uint32 `gorm:"primary_key;auto_increment" json:"id"` Name string `gorm:"size:1000;not null;" json:"name"` CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"` }
func (*Group) FillFields ¶
func (g *Group) FillFields()
func (*Group) FindGroupById ¶
type Question ¶
type Question struct { ID uint32 `gorm:"primary_key;auto_increment" json:"id"` Name string `gorm:"size:1000;not null;" json:"name"` Answers pq.StringArray `gorm:"type:text[];not null;" json:"answers"` Correct pq.StringArray `gorm:"type:text[];not null;" json:"correct"` CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"` GroupID uint32 `gorm:"type:bigserial;not null;" json:"group_id"` TestID pq.Int32Array `json:"test_id" gorm:"-"` }
func (*Question) DeleteQuestion ¶
func (*Question) FillFields ¶
func (q *Question) FillFields()
func (*Question) FindAllQuestions ¶
func (*Question) FindQuestionById ¶
func (*Question) UpdateQuestion ¶
type Test ¶
type Test struct { ID uint32 `gorm:"primary_key;auto_increment" json:"id"` Name string `gorm:"size:1000;not null" json:"name"` CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"` }
func (*Test) AddQuestionToTest ¶
func (*Test) FillFields ¶
func (t *Test) FillFields()
func (*Test) FindTestById ¶
type User ¶
type User struct { ID uint32 `gorm:"primary_key;auto_increment" json:"id"` Name string `gorm:"size:255;not null;" json:"name"` Email string `gorm:"size:100;not null;unique" json:"email"` Password string `gorm:"size:100;not null;" json:"password"` Role string `gorm:"size:100;not null;" json:"role"` CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"` }
func (*User) FillFields ¶
func (u *User) FillFields()
func (*User) HashPassword ¶
Click to show internal directories.
Click to hide internal directories.