Documentation
¶
Index ¶
- Constants
- Variables
- type CourseMock
- type CourseService
- func (service *CourseService) Create(contextControl domain.ContextControl, course domain.CourseDomain) (domain.CourseDomain, error)
- func (service *CourseService) GetByID(contextControl domain.ContextControl, ID int64) (domain.CourseDomain, bool, error)
- func (service *CourseService) GetCourses(contextControl domain.ContextControl, courses []domain.CourseDomain) ([]domain.CourseDomain, error)
- type StudentMock
- type StudentService
- func (service *StudentService) Create(contextControl domain.ContextControl, student domain.StudentDomain) (domain.StudentDomain, error)
- func (service *StudentService) GetByID(contextControl domain.ContextControl, ID int64) (domain.StudentDomain, bool, error)
- func (service *StudentService) GetStudents(contextControl domain.ContextControl, students []domain.StudentDomain) ([]domain.StudentDomain, error)
Constants ¶
View Source
const ( CourseErrorToSaveInCache = "error to save course in cache" CourseErrorToGetByIDInCache = "error to get course in cache" CourseDomainCacheRepositoryNotInitialized = "CourseDomainCacheRepository not initialized" CourseDomainDataBaseRepositoryNotInitialized = "CourseDomainDataBaseRepository not initialized" )
View Source
const ( StudentErrorToSaveInCache = "error to save student in cache" StudentErrorToGetByIDInCache = "error to get student in cache" StudentDomainCacheRepositoryNotInitialized = "StudentDomainCacheRepository not initialized" StudentDomainDataBaseRepositoryNotInitialized = "StudentDomainDataBaseRepository not initialized" )
View Source
const (
CourseCacheKeyTypeID = "ID"
)
View Source
const (
StudentCacheKeyTypeID = "ID"
)
Variables ¶
View Source
var CourseCacheTTL = 10 * time.Minute
View Source
var StudentCacheTTL = 10 * time.Minute
Functions ¶
This section is empty.
Types ¶
type CourseMock ¶
type CourseMock struct {
CreateMock func(contextControl domain.ContextControl, course domain.CourseDomain) (domain.CourseDomain, error)
GetByIDMock func(ID int64) (domain.CourseDomain, error)
}
func (CourseMock) Create ¶
func (c CourseMock) Create(contextControl domain.ContextControl, course domain.CourseDomain) (domain.CourseDomain, error)
func (CourseMock) GetByID ¶
func (c CourseMock) GetByID(ID int64) (domain.CourseDomain, error)
type CourseService ¶
type CourseService struct {
LoggerSugar *zap.SugaredLogger
CourseDomainDataBaseRepository output.ICourseDomainDataBaseRepository
CourseDomainCacheRepository output.ICourseDomainCacheRepository
}
func (*CourseService) Create ¶
func (service *CourseService) Create(contextControl domain.ContextControl, course domain.CourseDomain) (domain.CourseDomain, error)
func (*CourseService) GetByID ¶
func (service *CourseService) GetByID(contextControl domain.ContextControl, ID int64) (domain.CourseDomain, bool, error)
func (*CourseService) GetCourses ¶
func (service *CourseService) GetCourses(contextControl domain.ContextControl, courses []domain.CourseDomain) ([]domain.CourseDomain, error)
type StudentMock ¶
type StudentMock struct {
CreateMock func(contextControl domain.ContextControl, student domain.StudentDomain) (domain.StudentDomain, error)
GetByIDMock func(ID int64) (domain.StudentDomain, error)
}
func (StudentMock) Create ¶
func (c StudentMock) Create(contextControl domain.ContextControl, student domain.StudentDomain) (domain.StudentDomain, error)
func (StudentMock) GetByID ¶
func (c StudentMock) GetByID(ID int64) (domain.StudentDomain, error)
type StudentService ¶
type StudentService struct {
LoggerSugar *zap.SugaredLogger
StudentDomainDataBaseRepository output.IStudentDomainDataBaseRepository
StudentDomainCacheRepository output.IStudentDomainCacheRepository
}
func (*StudentService) Create ¶
func (service *StudentService) Create(contextControl domain.ContextControl, student domain.StudentDomain) (domain.StudentDomain, error)
func (*StudentService) GetByID ¶
func (service *StudentService) GetByID(contextControl domain.ContextControl, ID int64) (domain.StudentDomain, bool, error)
func (*StudentService) GetStudents ¶
func (service *StudentService) GetStudents(contextControl domain.ContextControl, students []domain.StudentDomain) ([]domain.StudentDomain, error)
Click to show internal directories.
Click to hide internal directories.