Documentation ¶
Overview ¶
Package studentservice holds the business logic and data structures associated with the student domain.
Index ¶
- type AtomicOperation
- type AtomicRepository
- type Config
- type Interface
- type MockAtomicOperation
- type MockAtomicRepository
- type MockInterface
- func (_m *MockInterface) DeleteStudent(ctx context.Context, u *ent.Student) error
- func (_m *MockInterface) GetStudent(ctx context.Context, u *ent.Student) error
- func (_m *MockInterface) GetStudentFromLogin(ctx context.Context, u *ent.Student) error
- func (_m *MockInterface) GetStudentsWithPagination(ctx context.Context, u *ent.Students, _a2 *pagination.Front) error
- func (_m *MockInterface) GetStudentsWithSearchWithPagination(ctx context.Context, u *ent.Students, us *ent.Student, _a3 *pagination.Front) error
- func (_m *MockInterface) ModifyProfile(ctx context.Context, u *ent.Student) error
- func (_m *MockInterface) Signin(ctx context.Context, u *ent.Student) error
- func (_m *MockInterface) Signup(ctx context.Context, u *ent.Student) error
- type MockRepository
- func (_m *MockRepository) CheckStudentPseudo(ctx context.Context, u *ent.Student) (bool, error)
- func (_m *MockRepository) CreateStudent(ctx context.Context, u *ent.Student) error
- func (_m *MockRepository) DeleteStudent(ctx context.Context, u *ent.Student) error
- func (_m *MockRepository) FindStudentByID(ctx context.Context, uid uuid.UUID) (*ent.Student, error)
- func (_m *MockRepository) FindStudentByLogin(ctx context.Context, login string) (*ent.Student, error)
- func (_m *MockRepository) FindStudentsByLoginOrFirstNameOrLastNameAtOffset(ctx context.Context, stud *ent.Student, off int, limit int) (ent.Students, error)
- func (_m *MockRepository) GetAllStudentsAtOffset(ctx context.Context, u *ent.Students, off int, limit int) error
- func (_m *MockRepository) GetTotalStudentByPseudoOrFirstNameOrLastNameCount(ctx context.Context, n *ent.Student) (int, error)
- func (_m *MockRepository) GetTotalStudentCount(ctx context.Context) (int, error)
- func (_m *MockRepository) UpdatePseudoUsernameAndPassword(ctx context.Context, u *ent.Student) error
- func (_m *MockRepository) UpdateStudent(ctx context.Context, u *ent.Student) error
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AtomicOperation ¶
type AtomicOperation func(context.Context, Repository) error
AtomicOperation is the format waited by AtomicRepository
type AtomicRepository ¶
type AtomicRepository interface {
Execute(context.Context, AtomicOperation) error
}
AtomicRepository will execute the repository with Transaction
type Config ¶
type Config struct { StudentRepository AtomicRepository Tracer trace.Tracer Logger *otelzap.Logger }
Config will hold repository and used utils that will be injected into this Service layer on service initialization
type Interface ¶
type Interface interface { GetStudent(ctx context.Context, u *ent.Student) error GetStudentsWithSearchWithPagination(ctx context.Context, u *ent.Students, us *ent.Student, pagination *pagination.Front) error GetStudentFromLogin(ctx context.Context, u *ent.Student) error GetStudentsWithPagination(ctx context.Context, u *ent.Students, pagination *pagination.Front) error ModifyProfile(ctx context.Context, u *ent.Student) error DeleteStudent(ctx context.Context, u *ent.Student) error Signup(ctx context.Context, u *ent.Student) error Signin(ctx context.Context, u *ent.Student) error }
Interface specifies the business operations of the service.
type MockAtomicOperation ¶
MockAtomicOperation is an autogenerated mock type for the AtomicOperation type
func NewMockAtomicOperation ¶
func NewMockAtomicOperation(t mockConstructorTestingTNewMockAtomicOperation) *MockAtomicOperation
NewMockAtomicOperation creates a new instance of MockAtomicOperation. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockAtomicOperation) Execute ¶
func (_m *MockAtomicOperation) Execute(_a0 context.Context, _a1 Repository) error
Execute provides a mock function with given fields: _a0, _a1
type MockAtomicRepository ¶
MockAtomicRepository is an autogenerated mock type for the AtomicRepository type
func NewMockAtomicRepository ¶
func NewMockAtomicRepository(t mockConstructorTestingTNewMockAtomicRepository) *MockAtomicRepository
NewMockAtomicRepository creates a new instance of MockAtomicRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockAtomicRepository) Execute ¶
func (_m *MockAtomicRepository) Execute(_a0 context.Context, _a1 AtomicOperation) error
Execute provides a mock function with given fields: _a0, _a1
type MockInterface ¶
MockInterface is an autogenerated mock type for the Interface type
func NewMockInterface ¶
func NewMockInterface(t mockConstructorTestingTNewMockInterface) *MockInterface
NewMockInterface creates a new instance of MockInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockInterface) DeleteStudent ¶
DeleteStudent provides a mock function with given fields: ctx, u
func (*MockInterface) GetStudent ¶
GetStudent provides a mock function with given fields: ctx, u
func (*MockInterface) GetStudentFromLogin ¶
GetStudentFromLogin provides a mock function with given fields: ctx, u
func (*MockInterface) GetStudentsWithPagination ¶
func (_m *MockInterface) GetStudentsWithPagination(ctx context.Context, u *ent.Students, _a2 *pagination.Front) error
GetStudentsWithPagination provides a mock function with given fields: ctx, u, _a2
func (*MockInterface) GetStudentsWithSearchWithPagination ¶
func (_m *MockInterface) GetStudentsWithSearchWithPagination(ctx context.Context, u *ent.Students, us *ent.Student, _a3 *pagination.Front) error
GetStudentsWithSearchWithPagination provides a mock function with given fields: ctx, u, us, _a3
func (*MockInterface) ModifyProfile ¶
ModifyProfile provides a mock function with given fields: ctx, u
type MockRepository ¶
MockRepository is an autogenerated mock type for the Repository type
func NewMockRepository ¶
func NewMockRepository(t mockConstructorTestingTNewMockRepository) *MockRepository
NewMockRepository creates a new instance of MockRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockRepository) CheckStudentPseudo ¶
CheckStudentPseudo provides a mock function with given fields: ctx, u
func (*MockRepository) CreateStudent ¶
CreateStudent provides a mock function with given fields: ctx, u
func (*MockRepository) DeleteStudent ¶
DeleteStudent provides a mock function with given fields: ctx, u
func (*MockRepository) FindStudentByID ¶
FindStudentByID provides a mock function with given fields: ctx, uid
func (*MockRepository) FindStudentByLogin ¶
func (_m *MockRepository) FindStudentByLogin(ctx context.Context, login string) (*ent.Student, error)
FindStudentByLogin provides a mock function with given fields: ctx, login
func (*MockRepository) FindStudentsByLoginOrFirstNameOrLastNameAtOffset ¶
func (_m *MockRepository) FindStudentsByLoginOrFirstNameOrLastNameAtOffset(ctx context.Context, stud *ent.Student, off int, limit int) (ent.Students, error)
FindStudentsByLoginOrFirstNameOrLastNameAtOffset provides a mock function with given fields: ctx, stud, off, limit
func (*MockRepository) GetAllStudentsAtOffset ¶
func (_m *MockRepository) GetAllStudentsAtOffset(ctx context.Context, u *ent.Students, off int, limit int) error
GetAllStudentsAtOffset provides a mock function with given fields: ctx, u, off, limit
func (*MockRepository) GetTotalStudentByPseudoOrFirstNameOrLastNameCount ¶
func (_m *MockRepository) GetTotalStudentByPseudoOrFirstNameOrLastNameCount(ctx context.Context, n *ent.Student) (int, error)
GetTotalStudentByPseudoOrFirstNameOrLastNameCount provides a mock function with given fields: ctx, n
func (*MockRepository) GetTotalStudentCount ¶
func (_m *MockRepository) GetTotalStudentCount(ctx context.Context) (int, error)
GetTotalStudentCount provides a mock function with given fields: ctx
func (*MockRepository) UpdatePseudoUsernameAndPassword ¶
func (_m *MockRepository) UpdatePseudoUsernameAndPassword(ctx context.Context, u *ent.Student) error
UpdatePseudoUsernameAndPassword provides a mock function with given fields: ctx, u
func (*MockRepository) UpdateStudent ¶
UpdateStudent provides a mock function with given fields: ctx, u
type Repository ¶
type Repository interface { CreateStudent(ctx context.Context, u *ent.Student) error UpdateStudent(ctx context.Context, u *ent.Student) error UpdatePseudoUsernameAndPassword(ctx context.Context, u *ent.Student) error GetAllStudentsAtOffset(ctx context.Context, u *ent.Students, off int, limit int) error GetTotalStudentCount(ctx context.Context) (int, error) GetTotalStudentByPseudoOrFirstNameOrLastNameCount(ctx context.Context, n *ent.Student) (int, error) FindStudentByID(ctx context.Context, uid uuid.UUID) (*ent.Student, error) FindStudentByLogin(ctx context.Context, login string) (*ent.Student, error) FindStudentsByLoginOrFirstNameOrLastNameAtOffset(ctx context.Context, stud *ent.Student, off int, limit int) (ent.Students, error) CheckStudentPseudo(ctx context.Context, u *ent.Student) (bool, error) DeleteStudent(ctx context.Context, u *ent.Student) error }
Repository contain all the function available in the defined domain