Documentation ¶
Index ¶
- type Course
- type CourseDB
- func (u *CourseDB) Exist(courseID string) bool
- func (c *CourseDB) GetAll() ([]*internal.Course, error)
- func (c *CourseDB) GetByID(id string) (*internal.Course, error)
- func (c *CourseDB) GetByUserID(id uint) ([]*internal.Course, error)
- func (c *CourseDB) GetManyByID(ids []string) ([]*internal.Course, error)
- func (c *CourseDB) SaveCourse(course *internal.Course, xpForTask int) error
- type CourseResult
- type CourseResultDB
- func (c *CourseResultDB) GetBestResultForUserForCourse(userID uint, courseID string) (*internal.CourseResult, error)
- func (c *CourseResultDB) ListAllForUser(userID uint) ([]internal.CourseResult, error)
- func (c *CourseResultDB) ListBestResultsForUser(userID uint) ([]internal.CourseResult, error)
- func (c *CourseResultDB) ListFinishedForUser(userID uint) ([]internal.CourseResult, error)
- func (c *CourseResultDB) ListResultsForCourse(courseID string) ([]internal.CourseResult, error)
- func (c *CourseResultDB) ListStartedForUser(userID uint) ([]internal.CourseResult, error)
- func (c *CourseResultDB) ReplaceIfExist(result *internal.CourseResult) (*internal.CourseResult, uint, error)
- func (c *CourseResultDB) SaveResult(course *internal.CourseResult) error
- type Database
- type Task
- type TaskDB
- func (c *TaskDB) GetByID(id uint) (*internal.Task, error)
- func (c *TaskDB) GetManyByID(ids []uint) ([]internal.Task, error)
- func (c *TaskDB) GetTasksForCourse(course *internal.Course) []internal.Task
- func (c *TaskDB) MapTasksForCourses(courses []*internal.Course) map[uint][]internal.Task
- func (c *TaskDB) RemoveByID(task *internal.Task) error
- func (c *TaskDB) SaveTask(task *internal.Task) error
- type User
- type UserDB
- func (u *UserDB) Exist(user *internal.User) bool
- func (u *UserDB) GetAll() ([]internal.User, error)
- func (u *UserDB) GetByID(id uint) (*internal.User, error)
- func (u *UserDB) GetByMail(email string) ([]internal.User, error)
- func (u *UserDB) GetManyByID(ids []uint) ([]internal.User, error)
- func (u *UserDB) SaveUser(user *internal.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CourseDB ¶
type CourseDB struct {
// contains filtered or unexported fields
}
func (*CourseDB) GetManyByID ¶
type CourseResult ¶
type CourseResult interface { SaveResult(course *internal.CourseResult) error ReplaceIfExist(result *internal.CourseResult) (*internal.CourseResult, uint, error) ListBestResultsForUser(userID uint) ([]internal.CourseResult, error) GetBestResultForUserForCourse(userID uint, courseID string) (*internal.CourseResult, error) ListAllForUser(userID uint) ([]internal.CourseResult, error) ListStartedForUser(userID uint) ([]internal.CourseResult, error) ListFinishedForUser(userID uint) ([]internal.CourseResult, error) ListResultsForCourse(courseID string) ([]internal.CourseResult, error) }
type CourseResultDB ¶
type CourseResultDB struct {
// contains filtered or unexported fields
}
func (*CourseResultDB) GetBestResultForUserForCourse ¶
func (c *CourseResultDB) GetBestResultForUserForCourse(userID uint, courseID string) (*internal.CourseResult, error)
func (*CourseResultDB) ListAllForUser ¶
func (c *CourseResultDB) ListAllForUser(userID uint) ([]internal.CourseResult, error)
func (*CourseResultDB) ListBestResultsForUser ¶
func (c *CourseResultDB) ListBestResultsForUser(userID uint) ([]internal.CourseResult, error)
func (*CourseResultDB) ListFinishedForUser ¶
func (c *CourseResultDB) ListFinishedForUser(userID uint) ([]internal.CourseResult, error)
func (*CourseResultDB) ListResultsForCourse ¶
func (c *CourseResultDB) ListResultsForCourse(courseID string) ([]internal.CourseResult, error)
func (*CourseResultDB) ListStartedForUser ¶
func (c *CourseResultDB) ListStartedForUser(userID uint) ([]internal.CourseResult, error)
func (*CourseResultDB) ReplaceIfExist ¶
func (c *CourseResultDB) ReplaceIfExist(result *internal.CourseResult) (*internal.CourseResult, uint, error)
func (*CourseResultDB) SaveResult ¶
func (c *CourseResultDB) SaveResult(course *internal.CourseResult) error
type Database ¶
type Database struct { User User Task Task Course Course CourseResult CourseResult }
type Task ¶
type Task interface { SaveTask(task *internal.Task) error GetTasksForCourse(course *internal.Course) []internal.Task MapTasksForCourses(courses []*internal.Course) map[uint][]internal.Task GetByID(id uint) (*internal.Task, error) GetManyByID(ids []uint) ([]internal.Task, error) RemoveByID(task *internal.Task) error }
type TaskDB ¶
type TaskDB struct {
// contains filtered or unexported fields
}
func (*TaskDB) GetTasksForCourse ¶
func (*TaskDB) MapTasksForCourses ¶
Click to show internal directories.
Click to hide internal directories.