Documentation
¶
Index ¶
- Variables
- type Storage
- type Student
- type StudentRepository
- type StudentStore
- func (s *StudentStore) Create(ctx context.Context, student *Student) error
- func (s *StudentStore) Delete(ctx context.Context, studentID int64) error
- func (s *StudentStore) GetByID(ctx context.Context, studentID int64) (*Student, error)
- func (s *StudentStore) Update(ctx context.Context, student *Student) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDuplicateEmail = errors.New("duplicate email") ErrNotFound = errors.New("resource not found") )
Functions ¶
This section is empty.
Types ¶
type Student ¶
type Student struct { ID int64 `json:"id"` FirstName string `json:"firstName" binding:"required"` LastName string `json:"lastName" binding:"required"` Email string `json:"email" binding:"required,email"` Age int `json:"age" binding:"required,gte=0,lte=150"` Sex string `json:"sex" binding:"required,oneof=M F Other"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Version int `json:"version"` }
type StudentRepository ¶
type StudentStore ¶
type StudentStore struct {
// contains filtered or unexported fields
}
func (*StudentStore) Create ¶
func (s *StudentStore) Create(ctx context.Context, student *Student) error
func (*StudentStore) Delete ¶
func (s *StudentStore) Delete(ctx context.Context, studentID int64) error
Click to show internal directories.
Click to hide internal directories.