moodl

package
v0.0.0-...-4fe524a Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MyCourses = Branch{
		Name: s("My courses"),
		Key:  s("mycourses"),
		Type: Root,
	}

	Courses = Branch{
		Name: s("Courses"),
		Key:  s("courses"),
		Type: Root,
	}

	Home = Branch{
		Children: &[]Branch{Courses, MyCourses},
		Type:     Root,
	}
)

Functions

func CLI

func CLI(args []string) int

Types

type Branch

type Branch struct {
	Name     *string   `json:"name"`
	Type     Type      `json:"type"`
	Key      *string   `json:"key"`
	Title    *string   `json:"title"`
	Link     *string   `json:"link"`
	Children *[]Branch `json:"children"`
	Parent   *Branch   `json:"-"`
	Viewed   bool      `json:"-"`
}

func (*Branch) IsViewable

func (br *Branch) IsViewable() bool

func (*Branch) PrintChildren

func (br *Branch) PrintChildren()

func (*Branch) UnmarshalJSON

func (br *Branch) UnmarshalJSON(data []byte) error

type Config

type Config struct {
	Out     string
	Verbose bool
}

type Student

type Student struct {
	Client  http.Client
	Site    url.URL
	Current *Branch
	Conf    Config
}

func FromArgs

func FromArgs(args []string) (Student, error)

func (*Student) Choose

func (s *Student) Choose(choice string) error

func (*Student) Download

func (s *Student) Download(b *Branch, out string) error

func (*Student) Login

func (s *Student) Login(user string, pass string) error

func (*Student) View

func (s *Student) View(b *Branch) (Branch, error)

type Type

type Type int
const (
	Root            Type = 0
	Category        Type = 10
	Course          Type = 20
	CourseStructure Type = 30
	Activity        Type = 40
	User            Type = 80
)

https://github.com/moodle/moodle/blob/fac49f8f7266099eef769ab4d1139f88fa5914d1/lib/navigationlib.php#L48

Jump to

Keyboard shortcuts

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