Documentation
¶
Index ¶
- Constants
- func Execute[T interface{ ... }](ctx context.Context, svc Service, cmd T) (any, error)
- type AddCourse
- type CounterCourse
- type CounterCourses
- type Course
- type CourseCommand
- type CourseID
- type CourseQuery
- type Courses
- type GetCourseByIDRepoAction
- type GetCourseByIDService
- type GetCoursesByIDRepoAction
- type GetCoursesByIDService
- type GetCoursesRepoAction
- type GetCoursesService
- type PostCourseRepoAction
- type PostCourseService
- type Repo
- type Service
- type Tag
- type Tags
Constants ¶
View Source
const ( LanguageIDPathParam = "languageID" CourseIDPathParam = "courseID" CollectionQueryParam = "collection" PostCoursesEndpoint = "/{" + LanguageIDPathParam + "}/collections/" GetCoursesEndpoint = "/{" + LanguageIDPathParam + "}/collections/{" + CourseIDPathParam + "}/" )
View Source
const ImageFileParamName string = "image"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddCourse ¶
type AddCourse struct { Title string `json:"title" example:"eventyr for barn"` Language string `json:"language" example:"no"` Description string `json:"description" example:"Du vil lære å lese eventyr for barn"` Level uint `json:"level" example:"2"` SourceURL string `json:"sourceUrl" example:"https://www.barneforlaget.no/hør-så-mye-du-vil"` Tags Tags `json:"tags"` }
type CounterCourse ¶
type CounterCourse struct { CardsCount uint `json:"cardsCount"` HasFlags bool `json:"hasFlags"` KnownWordsCount uint `json:"knownWordsCount"` TotalWordsCount uint `json:"totalWordsCount"` RoseGiven bool `json:"roseGiven"` RosesCount uint `json:"rosesCount"` LessonsCount uint `json:"lessonsCount"` Difficulty float32 `json:"difficulty"` IsTaken bool `json:"isTaken"` NewWordsCount uint `json:"newWordsCount"` CourseID int `json:"pk"` Progress any `json:"progress"` IsCompletelyTaken bool `json:"isCompletelyTaken"` UniqueWordsCount uint `json:"uniqueWordsCount"` }
type CounterCourses ¶
type CounterCourses map[CourseID]CounterCourse
type Course ¶
type Course struct { ID uint `json:"id"` URL string `json:"url"` Title string `json:"title"` Description string `json:"description"` ImageURL string `json:"imageUrl"` OriginalImageURL string `json:"originalImageUrl"` LessonsCount uint `json:"lessonsCount"` Difficulty float32 `json:"difficulty"` Tags Tags `json:"tags"` Type string `json:"type"` }
type CourseCommand ¶
type CourseCommand struct { rest.PostDummyRequester Image string Title string `example:"eventyr for barn"` Language string `example:"no"` Description string `example:"Du vil lære å lese eventyr for barn"` Level uint `example:"2"` SourceURL string `example:"https://www.barneforlaget.no/hør-så-mye-du-vil"` Tags Tags }
func (CourseCommand) After ¶
func (c CourseCommand) After(req *resty.Request) (*resty.Request, error)
func (CourseCommand) Files ¶
func (c CourseCommand) Files() map[string]string
func (CourseCommand) FormData ¶
func (c CourseCommand) FormData() url.Values
func (CourseCommand) ToPathParameter ¶
func (c CourseCommand) ToPathParameter() (map[string]string, error)
type CourseQuery ¶
type CourseQuery struct { rest.GetDummyRequester IDs []uint Title string Language string }
func (CourseQuery) Filter ¶
func (c CourseQuery) Filter()
func (CourseQuery) ToPathParameter ¶
func (c CourseQuery) ToPathParameter() (map[string]string, error)
type GetCourseByIDRepoAction ¶
type GetCourseByIDRepoAction interface {
GetCourseByID(context.Context, CourseQuery) (Course, error)
}
type GetCourseByIDService ¶
type GetCourseByIDService interface {
GetCourse(context.Context, CourseQuery) (Course, error)
}
type GetCoursesByIDRepoAction ¶
type GetCoursesByIDRepoAction interface {
GetCoursesByID(context.Context, CourseQuery) (CounterCourses, error)
}
type GetCoursesByIDService ¶
type GetCoursesByIDService interface {
GetCoursesByID(context.Context, CourseQuery) (CounterCourses, error)
}
type GetCoursesRepoAction ¶
type GetCoursesService ¶
type PostCourseRepoAction ¶
type PostCourseRepoAction interface {
PostCourse(context.Context, CourseCommand) (Course, error)
}
type PostCourseService ¶
type PostCourseService interface {
PostCourse(context.Context, CourseCommand) (Course, error)
}
type Repo ¶
type Repo interface { PostCourseRepoAction GetCoursesRepoAction GetCourseByIDRepoAction GetCoursesByIDRepoAction }
type Service ¶
type Service struct { PostCourseService GetCoursesService GetCourseByIDService GetCoursesByIDService }
func NewService ¶
Click to show internal directories.
Click to hide internal directories.