Documentation ¶
Overview ¶
Package student is a domain package wich contains the student features and behavior.
Index ¶
- Variables
- func WithEmail(email string) baseuser.Option
- func WithID(id string) baseuser.Option
- func WithPassword(password string) baseuser.Option
- func WithScope(scope string) baseuser.Option
- type GetStudents
- type GetStudentsRepository
- type RegisterStudent
- type RegisterStudentRepository
- type Student
- type StudentUpdater
- type UpdateStudentRepository
Constants ¶
This section is empty.
Variables ¶
var ErrEmailAlreadyExists = errors.New("email already exists")
var ErrEmptyPropertyValue = errors.New("empty property value")
var ErrInvalidCredentials = errors.New("invalid credentials")
var ErrInvalidStudentProp = errors.New("invalid student property")
var ErrMissingStudentID = errors.New("missing student id")
GetMeOptions validations
var ErrNoDataToSync = errors.New("no data to sync")
var ErrNoStudentsFound = errors.New("no students found")
var ErrStudentIDInvalid = errors.New("student id invalid")
Functions ¶
func WithEmail ¶
WithEmail returns a baseuser.Option that sets the Email of a student.
It receives a string and sets the Email of the student. If the string is empty, it will return an error.
func WithID ¶
WithID returns a baseuser.Option that sets the ID of a student.
It receives a string and sets the ID of the student. If the string is empty, it will return an error.
func WithPassword ¶
WithPassword returns a baseuser.Option that sets the Password of a student.
Types ¶
type GetStudents ¶
GetStudents is the usecase to get all students Not implemented yet
type GetStudentsRepository ¶
type GetStudentsRepository interface { // Run executes the Get Students query. // // Example: // // students, err := repo.Run(context.Backround(), filters.New(), paginator.NewConditions()) // Run(ctx context.Context, f filters.FilterConditions, p paginator.Paginator) ([]Student, error) }
GetStudentsRepository is the repository implementation for Get Students.
type RegisterStudent ¶
RegisterStudent is the usecase to register a new student
type RegisterStudentRepository ¶
type RegisterStudentRepository interface { // Run executes the Register Student query. // // Example: // // newStudent, err := repo.Run(context.Backround(), student) // Run(ctx context.Context, s Student) (Student, error) }
RegisterStudentRepository is the repository implementation for Register Student.
type Student ¶
Student is has the baseUser interface implemented
func NewStudent ¶
NewStudent returns a new student instance.
It receive an array of options and applies them to the student instance. If has no options, the instance will be empty.
type StudentUpdater ¶
StudentUpdater is a interface who defines the UpdateStudentRepository method
type UpdateStudentRepository ¶
type UpdateStudentRepository interface { // Run executes the update in student Run(ctx context.Context, usrID string, u StudentUpdater) (Student, error) }
UpdateStudentRepository is repository implementation for Update Student.