Documentation ¶
Index ¶
- Constants
- Variables
- func Create(ctx context.Context, m *CreateArgs) (string, error)
- func CreateContent(ctx context.Context, m *CreateContentArgs) (string, error)
- func DeleteContent(ctx context.Context, contentID string) error
- func GetIDByURL(ctx context.Context, url string) (courseID string, err error)
- func GetIDFromContent(ctx context.Context, contentID string) (courseID string, err error)
- func GetURL(ctx context.Context, id string) (string, error)
- func GetUserID(ctx context.Context, id string) (string, error)
- func InsertEnroll(ctx context.Context, courseID, userID string) error
- func IsEnroll(ctx context.Context, userID, courseID string) (bool, error)
- func SetImage(ctx context.Context, id string, img string) error
- func SetOption(ctx context.Context, id string, opt Option) error
- func Update(ctx context.Context, m *UpdateArgs) error
- func UpdateContent(ctx context.Context, m *UpdateContentArgs) error
- type Assignment
- type Content
- type Course
- type CreateArgs
- type CreateContentArgs
- type Option
- type PublicCard
- type UpdateArgs
- type UpdateContentArgs
Constants ¶
View Source
const ( Live Video EBook )
Course type values
View Source
const (
Youtube
)
Video type values
Variables ¶
View Source
var (
ErrNotFound = errors.New("course: not found")
)
Functions ¶
func Create ¶
func Create(ctx context.Context, m *CreateArgs) (string, error)
Create creates new course
func CreateContent ¶
func CreateContent(ctx context.Context, m *CreateContentArgs) (string, error)
CreateContent creates new course content
func DeleteContent ¶
DeleteContent deletes a course's content
func GetIDFromContent ¶
func InsertEnroll ¶
InsertEnroll inserts enroll
func UpdateContent ¶
func UpdateContent(ctx context.Context, m *UpdateContentArgs) error
UpdateContent updates a course content
Types ¶
type Assignment ¶
Assignment model
func GetAssignments ¶
func GetAssignments(ctx context.Context, courseID string) ([]*Assignment, error)
type Content ¶
type Content struct { ID string CourseID string Title string Desc string VideoID string VideoType int DownloadURL string }
Content type
func GetContent ¶
GetContent gets a course's content
type Course ¶
type Course struct { ID string Option Option Title string ShortDesc string Desc string Image string Owner struct { ID string Name string Image string } Start time.Time URL string Type int Price float64 Discount float64 EnrollDetail string }
Course model
type CreateArgs ¶
type CreateContentArgs ¶
type PublicCard ¶
type PublicCard struct { ID string Option Option Title string Desc string Image string Start time.Time URL string Type int Price float64 Discount float64 }
func GetPublicCards ¶
func GetPublicCards(ctx context.Context) ([]*PublicCard, error)
func (*PublicCard) ShowStart ¶
func (x *PublicCard) ShowStart() bool
ShowStart returns true if course should show start date
type UpdateArgs ¶
Click to show internal directories.
Click to hide internal directories.