service

package
v0.0.0-...-732b81e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL