An open API service indexing awesome lists of open source software.

https://github.com/zaddok/moodle

Golang Moodle Api
https://github.com/zaddok/moodle

api golang moodle moodle-api moodleapi

Last synced: 6 months ago
JSON representation

Golang Moodle Api

Awesome Lists containing this project

README

          

# Moodle API for Golang

This is a simple Moodle API that wraps the Moodle JSON Web Service API.
It is part of a project that is currently in use in a live production environment, and
is under active development.

It was developed in a hurry, no warranty is given or implied. Use at your own risk. Pull requests welcome.

## Example usage

// Setup
api := moodle.NewMoodleApi("https://moodle.example.com/moodle/", "a0092ba9a9f5b45cdd2f01d049595bfe91", l)

// Search moodle courses
courses, _ := api.GetCourses("History")
if courses != nil {
for _, i := range *courses {
fmt.Printf("%s\n", i.Code)
}
}

// Search users
people, err := api.GetPeopleByAttribute("email", "%")
if err != nil {
l.Error("%v", err)
return
}
fmt.Println("People:")
for _, p := range *people {
// Do something
}