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
- Host: GitHub
- URL: https://github.com/zaddok/moodle
- Owner: zaddok
- Created: 2018-02-24T03:54:34.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-03-21T07:24:30.000Z (over 2 years ago)
- Last Synced: 2024-06-19T00:33:08.206Z (about 2 years ago)
- Topics: api, golang, moodle, moodle-api, moodleapi
- Language: Go
- Size: 97.7 KB
- Stars: 15
- Watchers: 2
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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
}