Categorygithub.com/mnasruul/moodleClient
modulepackage
1.0.1
Repository: https://github.com/mnasruul/moodleclient.git
Documentation: pkg.go.dev

# README

moodle

License: MIT Tests Workflow codecov Go Report Card

Go Moodle API Client

Example

package main

import (
	"context"
	"fmt"
	"github.com/mnasruul/moodleClient"
	"net/url"
)

func main() {
	ctx := context.Background()
	serviceURL, err := url.Parse("https://my.uopeople.edu")
	if err != nil {
		panic(err)
	}
	moodleClient, err := moodle.NewClientWithLogin(
		ctx,
		serviceURL,
		"SXXXXXX",
		"password",
	)
	if err != nil {
		panic(err)
	}

	siteInfo, err := moodleClient.SiteAPI.GetSiteInfo(ctx)
	if err != nil {
		panic(err)
	}

	fmt.Printf("%#v\n", siteInfo)

	courses, err := moodleClient.CourseAPI.GetEnrolledCoursesByTimelineClassification(
		ctx,
		moodle.CourseClassificationInProgress,
	)
	if err != nil {
		panic(err)
	}

	for _, c := range courses {
		fmt.Printf("%#v\n", c)
	}
}

# Packages

No description provided by the author
No description provided by the author

# Functions

No description provided by the author
NewClient creates a new Moodle client.
NewClientWithLogin creates a new Moodle client with token retrieved from login request.
WithDebugEnabled enable debug logs this option is should be used in development only.
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
Client is a Moodle API client scoped to a service.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GradeItem represents an grade If you want to know percentage of the grade out of course total grade, see GradeTableItem.
GradeTable represents a grade table for a course.
No description provided by the author
GradeTableItemGroup represents a group of grade items.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author
ClientOption is a option to change client configuration.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author