mooc

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TopLevel = "week"
	Regular  = "task"
)

Variables

This section is empty.

Functions

func GetMOOCSlug

func GetMOOCSlug(courseReference string) (string, error)

func GetSlugFromURLPath

func GetSlugFromURLPath(path string) (string, error)

GetSlugFromURLPath retrieves a course slug from given path, as "defined" in the general form [scheme:][//[userinfo@]host][/]path[?query][#fragment] See: https://golang.org/pkg/net/url/#URL

Types

type CourseSyllabus

type CourseSyllabus struct {
	Weeks []Week `json:"weeks"`
}

func (CourseSyllabus) Validate

func (cs CourseSyllabus) Validate() error

type ExportOptions

type ExportOptions struct {
	TaskPriority Priority
	StartingDate time.Time
	TasksPerDay  uint32
	SkipWeekends bool
	AutoDate     bool
}

type Exporter

type Exporter interface {
	Export(cs CourseSyllabus) ([]byte, error)
}

type Importer

type Importer interface {
	Import() (CourseSyllabus, error)
}

type Item

type Item struct {
	Title    string `json:"title"`
	Duration string `json:"duration"`
}

type JsonExporter

type JsonExporter struct {
}

func (*JsonExporter) Export

func (e *JsonExporter) Export(cs CourseSyllabus) ([]byte, error)

type Priority

type Priority uint8
const (
	PriorityNone Priority = iota
	PriorityRed
	PriorityYellow
	PriorityBlue
	PriorityGrey
)

type Task

type Task struct {
	Priority Priority
	No       uint32
	Title    string
	Type     string
	Date     time.Time
}

Task is a Todoist equivalent of a MOOC "item":

  • week info
  • lecture video
  • quiz etc.

type TodoistExporter

type TodoistExporter struct {
	Opt ExportOptions
}

func (*TodoistExporter) Export

func (e *TodoistExporter) Export(cs CourseSyllabus) ([]byte, error)

type Week

type Week struct {
	Title string `json:"title"`
	Items []Item `json:"items"`
}

Jump to

Keyboard shortcuts

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