Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGetStudents ¶
func NewGetStudents(db database.Database) student.GetStudentsRepository
NewGetStudents will return a student.GetStudentsRepository implementation
func NewRegisterStudent ¶
func NewRegisterStudent(db database.Database) student.RegisterStudentRepository
func NewUpdateStudent ¶
func NewUpdateStudent(db database.Database) student.UpdateStudentRepository
NewUpdateStudent will return a student.UpdateStudentRepository implementation
Types ¶
type StudentModel ¶
type StudentModel struct { ID string `gorm:"primary_key;column:usr_id;type:uuid;default:uuid_generate_v4();index:idx_usr_id"` Email string `gorm:"column:usr_email;unique;type:varchar(255);"` Password string `gorm:"column:usr_password;type:varchar(255)"` Type string `gorm:"column:usr_scope;type:varchar(64);default:student"` CreatedAt time.Time `gorm:"column:usr_created_at;type:timestamp with time zone;default:now()"` UpdatedAt time.Time `gorm:"column:usr_updated_at;type:timestamp with time zone;default:now()"` }
StudentModel represents how a student is stored in the database.
func (*StudentModel) AsDomain ¶
func (s *StudentModel) AsDomain() student.Student
func (*StudentModel) BeforeCreate ¶
func (s *StudentModel) BeforeCreate(*gorm.DB) error
BeforeCreate is a hook to set the created_at, updated_at fields and generate uuid random.
Read more about GORM hooks:
func (*StudentModel) BeforeUpdate ¶
func (s *StudentModel) BeforeUpdate(tx *gorm.DB) error
BeforeUpdate is a hook to set the updated_at field.
Read more about GORM hooks:
func (StudentModel) TableName ¶
func (StudentModel) TableName() string
TableName overrides the table name used by StudentModel to `users`
Read more about GORM conventions:
Click to show internal directories.
Click to hide internal directories.