Documentation ¶
Index ¶
- Variables
- func GetSystemSpaceID() userD.SpaceID
- func GetSystemStudentID() userD.AppUserID
- func GetTatoebaWorkbookID() domain.WorkbookID
- func InitAppProperties(systemSpaceID userD.SpaceID, systemStudentID userD.AppUserID, ...)
- func SetSystemSpaceID(propertiesSystemSpaceID userD.SpaceID)
- func SetSystemStudentID(propertiesSystemStudentID userD.AppUserID)
- func SetTatoebaWorkbookID(propertiesTatoebaWorkbookID domain.WorkbookID)
- type Added
- type Audio
- type GuestStudent
- type Problem
- type ProblemAddParameter
- type ProblemAddParameterIterator
- type ProblemAddProcessor
- type ProblemFeature
- type ProblemIDsCondition
- type ProblemImportProcessor
- type ProblemQuotaProcessor
- type ProblemRemoveProcessor
- type ProblemRepository
- type ProblemSearchCondition
- type ProblemSearchResult
- type ProblemSelectParameter1
- type ProblemSelectParameter2
- type ProblemTypeRepository
- type ProblemUpdateParameter
- type ProblemUpdateProcessor
- type ProblemWithResults
- type ProcessorFactory
- type QuotaName
- type QuotaUnit
- type Recordbook
- type RecordbookRepository
- type RecordbookSummary
- type RepositoryFactory
- type RepositoryFactoryFunc
- type Student
- type StudyTypeRepository
- type SynthesizerClient
- type SystemStudent
- type Updated
- type UserQuotaRepository
- type Workbook
- type WorkbookAddParameter
- type WorkbookRepository
- type WorkbookSearchCondition
- type WorkbookSearchResult
- type WorkbookUpdateParameter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SystemStudentLoginID = "system-student" TatoebaWorkbookName = "tatoeba" OrganizationName = "cocotola" UserRfFunc userS.RepositoryFactoryFunc RfFunc RepositoryFactoryFunc )
View Source
var ( ErrQuotaExceeded = errors.New("quota exceeded") QuotaUnitPersitance QuotaUnit = "persitance" QuotaUnitMonth QuotaUnit = "month" QuotaUnitDay QuotaUnit = "day" QuotaNameSize QuotaName = "Size" QuotaNameUpdate QuotaName = "Update" )
View Source
var ErrAudioNotFound = errors.New("audio not found")
View Source
var ErrProblemAlreadyExists = errors.New("problem already exists")
View Source
var ErrProblemNotFound = errors.New("problem not found")
View Source
var ErrProblemOtherError = errors.New("problem other error")
View Source
var ErrStudyResultNotFound = errors.New("StudyResult not found")
View Source
var ErrWorkbookAlreadyExists = errors.New("workbook already exists")
View Source
var ErrWorkbookNotFound = errors.New("workbook not found")
View Source
var ErrWorkbookPermissionDenied = errors.New("permission denied")
Functions ¶
func GetSystemSpaceID ¶
func GetSystemStudentID ¶
func GetTatoebaWorkbookID ¶
func GetTatoebaWorkbookID() domain.WorkbookID
func InitAppProperties ¶
func SetSystemSpaceID ¶
func SetSystemStudentID ¶
func SetTatoebaWorkbookID ¶
func SetTatoebaWorkbookID(propertiesTatoebaWorkbookID domain.WorkbookID)
Types ¶
type Audio ¶
type Audio interface {
GetAudioModel() domain.AudioModel
}
type GuestStudent ¶
type GuestStudent interface { domain.StudentModel GetDefaultSpace(ctx context.Context) (userS.Space, error) FindWorkbooksFromPublicSpace(ctx context.Context, condition WorkbookSearchCondition) (WorkbookSearchResult, error) }
func NewGuestStudent ¶
func NewGuestStudent(pf ProcessorFactory, rf RepositoryFactory, userRf userS.RepositoryFactory, studentModel domain.StudentModel) (GuestStudent, error)
type Problem ¶
type Problem interface { domain.ProblemModel ProblemFeature }
func NewProblem ¶
func NewProblem(synthesizerClient SynthesizerClient, problemModel domain.ProblemModel) (Problem, error)
type ProblemAddParameter ¶
type ProblemAddParameter interface { GetWorkbookID() domain.WorkbookID GetNumber() int GetProperties() map[string]string }
func NewProblemAddParameter ¶
func NewProblemAddParameter(workbookID domain.WorkbookID, number int, properties map[string]string) (ProblemAddParameter, error)
type ProblemAddParameterIterator ¶
type ProblemAddParameterIterator interface {
Next() (ProblemAddParameter, error)
}
type ProblemAddProcessor ¶
type ProblemAddProcessor interface {
AddProblem(ctx context.Context, repo RepositoryFactory, operator domain.StudentModel, workbookModel domain.WorkbookModel, param ProblemAddParameter) ([]domain.ProblemID, error)
}
type ProblemFeature ¶
type ProblemFeature interface { }
type ProblemIDsCondition ¶
type ProblemIDsCondition interface { GetWorkbookID() domain.WorkbookID GetIDs() []domain.ProblemID }
func NewProblemIDsCondition ¶
func NewProblemIDsCondition(workbookID domain.WorkbookID, ids []domain.ProblemID) (ProblemIDsCondition, error)
type ProblemImportProcessor ¶
type ProblemImportProcessor interface {
CreateCSVReader(ctx context.Context, workbookID domain.WorkbookID, reader io.Reader) (ProblemAddParameterIterator, error)
}
type ProblemQuotaProcessor ¶
type ProblemRemoveProcessor ¶
type ProblemRemoveProcessor interface {
RemoveProblem(ctx context.Context, repo RepositoryFactory, operator domain.StudentModel, id ProblemSelectParameter2) error
}
type ProblemRepository ¶
type ProblemRepository interface { // FindProblems searches for problems based on search condition FindProblems(ctx context.Context, operator domain.StudentModel, param ProblemSearchCondition) (ProblemSearchResult, error) FindAllProblems(ctx context.Context, operator domain.StudentModel, workbookID domain.WorkbookID) (ProblemSearchResult, error) FindProblemsByProblemIDs(ctx context.Context, operator domain.StudentModel, param ProblemIDsCondition) (ProblemSearchResult, error) FindProblemsByCustomCondition(ctx context.Context, operator domain.StudentModel, condition interface{}) ([]domain.ProblemModel, error) FindProblemByID(ctx context.Context, operator domain.StudentModel, id ProblemSelectParameter1) (Problem, error) FindProblemIDs(ctx context.Context, operator domain.StudentModel, workbookID domain.WorkbookID) ([]domain.ProblemID, error) // AddProblem register a new problem AddProblem(ctx context.Context, operator domain.StudentModel, param ProblemAddParameter) (domain.ProblemID, error) UpdateProblem(ctx context.Context, operator domain.StudentModel, id ProblemSelectParameter2, param ProblemUpdateParameter) error RemoveProblem(ctx context.Context, operator domain.StudentModel, id ProblemSelectParameter2) error CountProblems(ctx context.Context, operator domain.StudentModel, workbookID domain.WorkbookID) (int, error) }
type ProblemSearchCondition ¶
type ProblemSearchCondition interface { GetWorkbookID() domain.WorkbookID GetPageNo() int GetPageSize() int GetKeyword() string }
func NewProblemSearchCondition ¶
func NewProblemSearchCondition(workbookID domain.WorkbookID, pageNo, pageSize int, keyword string) (ProblemSearchCondition, error)
type ProblemSearchResult ¶
type ProblemSearchResult interface { GetTotalCount() int GetResults() []domain.ProblemModel }
func NewProblemSearchResult ¶
func NewProblemSearchResult(totalCount int, results []domain.ProblemModel) (ProblemSearchResult, error)
type ProblemSelectParameter1 ¶
type ProblemSelectParameter1 interface { GetWorkbookID() domain.WorkbookID GetProblemID() domain.ProblemID }
func NewProblemSelectParameter1 ¶
func NewProblemSelectParameter1(WorkbookID domain.WorkbookID, problemID domain.ProblemID) (ProblemSelectParameter1, error)
type ProblemSelectParameter2 ¶
type ProblemSelectParameter2 interface { GetWorkbookID() domain.WorkbookID GetProblemID() domain.ProblemID GetVersion() int }
func NewProblemSelectParameter2 ¶
func NewProblemSelectParameter2(WorkbookID domain.WorkbookID, problemID domain.ProblemID, version int) (ProblemSelectParameter2, error)
type ProblemTypeRepository ¶
type ProblemTypeRepository interface {
FindAllProblemTypes(ctx context.Context) ([]domain.ProblemType, error)
}
type ProblemUpdateParameter ¶
type ProblemUpdateParameter interface { GetNumber() int GetProperties() map[string]string GetStringProperty(name string) (string, error) GetIntProperty(name string) (int, error) }
func NewProblemUpdateParameter ¶
func NewProblemUpdateParameter(number int, properties map[string]string) (ProblemUpdateParameter, error)
type ProblemUpdateProcessor ¶
type ProblemUpdateProcessor interface {
UpdateProblem(ctx context.Context, repo RepositoryFactory, operator domain.StudentModel, workbookModel domain.WorkbookModel, id ProblemSelectParameter2, param ProblemUpdateParameter) (Added, Updated, error)
}
type ProblemWithResults ¶
type ProblemWithResults interface { domain.ProblemModel GetResults() []bool GetLevel() int }
func NewProblemWithResults ¶
func NewProblemWithResults(problem domain.ProblemModel, results []bool, level int) ProblemWithResults
type ProcessorFactory ¶
type ProcessorFactory interface { NewProblemAddProcessor(processorType string) (ProblemAddProcessor, error) NewProblemUpdateProcessor(processorType string) (ProblemUpdateProcessor, error) NewProblemRemoveProcessor(processorType string) (ProblemRemoveProcessor, error) NewProblemImportProcessor(processorType string) (ProblemImportProcessor, error) NewProblemQuotaProcessor(processorType string) (ProblemQuotaProcessor, error) }
func NewProcessorFactory ¶
func NewProcessorFactory(addProcessors map[string]ProblemAddProcessor, updateProcessors map[string]ProblemUpdateProcessor, removeProcessors map[string]ProblemRemoveProcessor, importProcessors map[string]ProblemImportProcessor, quotaProcessors map[string]ProblemQuotaProcessor) ProcessorFactory
type Recordbook ¶
type Recordbook interface { GetStudent() Student GetWorkbookID() domain.WorkbookID GetResults(ctx context.Context) (map[domain.ProblemID]domain.StudyRecord, error) GetResultsSortedLevel(ctx context.Context) ([]domain.StudyRecordWithProblemID, error) SetResult(ctx context.Context, problemType string, problemID domain.ProblemID, result, memorized bool) error }
func NewRecordbook ¶
func NewRecordbook(rf RepositoryFactory, student Student, workbookID domain.WorkbookID, studyType string) (Recordbook, error)
type RecordbookRepository ¶
type RecordbookRepository interface { FindStudyRecords(ctx context.Context, operator domain.StudentModel, workbookID domain.WorkbookID, studyType string) (map[domain.ProblemID]domain.StudyRecord, error) SetResult(ctx context.Context, operator domain.StudentModel, workbookID domain.WorkbookID, studyType string, problemType string, problemID domain.ProblemID, studyResult, memorized bool) error CountMemorizedProblem(ctx context.Context, operator domain.StudentModel, workbookID domain.WorkbookID) (map[string]int, error) }
type RecordbookSummary ¶
func NewRecordbookSummary ¶
func NewRecordbookSummary(rf RepositoryFactory, student Student, workbookID domain.WorkbookID) (RecordbookSummary, error)
type RepositoryFactory ¶
type RepositoryFactory interface { NewWorkbookRepository(ctx context.Context) (WorkbookRepository, error) NewProblemRepository(ctx context.Context, problemType string) (ProblemRepository, error) NewProblemTypeRepository(ctx context.Context) ProblemTypeRepository NewStudyTypeRepository(ctx context.Context) StudyTypeRepository NewRecordbookRepository(ctx context.Context) RecordbookRepository NewUserQuotaRepository(ctx context.Context) UserQuotaRepository }
type RepositoryFactoryFunc ¶
type Student ¶
type Student interface { domain.StudentModel GetDefaultSpace(ctx context.Context) (userS.Space, error) GetPersonalSpace(ctx context.Context) (userS.Space, error) FindWorkbooksFromPersonalSpace(ctx context.Context, condition WorkbookSearchCondition) (WorkbookSearchResult, error) FindWorkbookByID(ctx context.Context, id domain.WorkbookID) (Workbook, error) FindWorkbookByName(ctx context.Context, name string) (Workbook, error) AddWorkbookToPersonalSpace(ctx context.Context, parameter WorkbookAddParameter) (domain.WorkbookID, error) UpdateWorkbook(ctx context.Context, workbookID domain.WorkbookID, version int, parameter WorkbookUpdateParameter) error RemoveWorkbook(ctx context.Context, id domain.WorkbookID, version int) error CheckQuota(ctx context.Context, problemType string, name QuotaName) error IncrementQuotaUsage(ctx context.Context, problemType string, name QuotaName, value int) error DecrementQuotaUsage(ctx context.Context, problemType string, name QuotaName, value int) error FindRecordbook(ctx context.Context, workbookID domain.WorkbookID, studyType string) (Recordbook, error) FindRecordbookSummary(ctx context.Context, workbookID domain.WorkbookID) (RecordbookSummary, error) }
func NewStudent ¶
func NewStudent(pf ProcessorFactory, rf RepositoryFactory, userRf userS.RepositoryFactory, studentModel domain.StudentModel) (Student, error)
type StudyTypeRepository ¶
type SynthesizerClient ¶
type SystemStudent ¶
type SystemStudent interface { userD.AppUserModel FindWorkbookFromSystemSpace(ctx context.Context, name string) (Workbook, error) AddWorkbookToSystemSpace(ctx context.Context, parameter WorkbookAddParameter) (domain.WorkbookID, error) }
func NewSystemStudent ¶
func NewSystemStudent(rf RepositoryFactory, appUser userD.AppUserModel) (SystemStudent, error)
type UserQuotaRepository ¶
type Workbook ¶
type Workbook interface { domain.WorkbookModel // FindProblems searches for problems based on search condition FindProblems(ctx context.Context, operator domain.StudentModel, param ProblemSearchCondition) (ProblemSearchResult, error) FindAllProblems(ctx context.Context, operator domain.StudentModel) (ProblemSearchResult, error) FindProblemsByProblemIDs(ctx context.Context, operator domain.StudentModel, param ProblemIDsCondition) (ProblemSearchResult, error) FindProblemIDs(ctx context.Context, operator domain.StudentModel) ([]domain.ProblemID, error) // FindProblems searches for problem based on a problem ID FindProblemByID(ctx context.Context, operator domain.StudentModel, problemID domain.ProblemID) (Problem, error) AddProblem(ctx context.Context, operator domain.StudentModel, param ProblemAddParameter) ([]domain.ProblemID, error) UpdateProblem(ctx context.Context, operator domain.StudentModel, id ProblemSelectParameter2, param ProblemUpdateParameter) (Added, Updated, error) RemoveProblem(ctx context.Context, operator domain.StudentModel, id ProblemSelectParameter2) error UpdateWorkbook(ctx context.Context, operator domain.StudentModel, version int, parameter WorkbookUpdateParameter) error RemoveWorkbook(ctx context.Context, operator domain.StudentModel, version int) error CountProblems(ctx context.Context, operator domain.StudentModel) (int, error) }
func NewWorkbook ¶
func NewWorkbook(rf RepositoryFactory, pf ProcessorFactory, workbookModel domain.WorkbookModel) (Workbook, error)
type WorkbookAddParameter ¶
type WorkbookRepository ¶
type WorkbookRepository interface { FindPersonalWorkbooks(ctx context.Context, operator domain.StudentModel, param WorkbookSearchCondition) (WorkbookSearchResult, error) FindWorkbookByID(ctx context.Context, operator domain.StudentModel, id domain.WorkbookID) (Workbook, error) FindWorkbookByName(ctx context.Context, operator userD.AppUserModel, spaceID userD.SpaceID, name string) (Workbook, error) AddWorkbook(ctx context.Context, operator userD.AppUserModel, spaceID userD.SpaceID, param WorkbookAddParameter) (domain.WorkbookID, error) UpdateWorkbook(ctx context.Context, operator domain.StudentModel, workbookID domain.WorkbookID, version int, param WorkbookUpdateParameter) error RemoveWorkbook(ctx context.Context, operator domain.StudentModel, workbookID domain.WorkbookID, version int) error }
type WorkbookSearchCondition ¶
type WorkbookSearchCondition interface { GetPageNo() int GetPageSize() int GetSpaceIDs() []userD.SpaceID }
func NewWorkbookSearchCondition ¶
func NewWorkbookSearchCondition(pageNo, pageSize int, spaceIDs []userD.SpaceID) (WorkbookSearchCondition, error)
type WorkbookSearchResult ¶
type WorkbookSearchResult interface { GetTotalCount() int GetResults() []domain.WorkbookModel }
func NewWorkbookSearchResult ¶
func NewWorkbookSearchResult(totalCount int, results []domain.WorkbookModel) (WorkbookSearchResult, error)
type WorkbookUpdateParameter ¶
func NewWorkbookUpdateParameter ¶
func NewWorkbookUpdateParameter(name, questionText string) (WorkbookUpdateParameter, error)
Source Files ¶
- app_properties.go
- audio.go
- guest_student.go
- problem.go
- problem_iterrator.go
- problem_processor.go
- problem_repository.go
- problem_type_repository.go
- processor_factory.go
- recordbook.go
- recordbook_repository.go
- repository_factory.go
- student.go
- study_type_repository.go
- synthesizer_client.go
- system_student.go
- user_quota_repository.go
- workbook.go
- workbook_repository.go
Click to show internal directories.
Click to hide internal directories.