moodle

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*http.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(host, username, password string) (*Client, error)

func (*Client) GetCourseSections

func (client *Client) GetCourseSections(courseId int) ([]Section, error)

func (*Client) GetFileBytes

func (client *Client) GetFileBytes(content *Content) ([]byte, error)

func (*Client) UpdateToken

func (client *Client) UpdateToken(username, password string) error

type Content

type Content struct {
	Type           string
	FileName       string
	FilePath       string
	FileSize       int
	FileUrl        string
	TimeCreated    int64
	TimeModified   int64
	SortOrder      int
	Mimetype       string
	IsExternalFile bool
	UserId         int
	Author         string
	License        string
}

type ContentsInfo

type ContentsInfo struct {
	FilesCount     int
	FilesSize      int
	LastModified   int
	MimeTypes      []string
	RepositoryType string
}

type Module

type Module struct {
	Id                  int
	Url                 string
	Name                string
	Instance            int
	Description         string
	Visible             int
	UserVisible         bool
	VisibleOnCoursePage int
	ModIcon             string
	ModName             string
	ModPlural           string
	Indent              int
	OnClick             string
	AfterLink           string
	CustomData          string
	NoViewLink          bool
	Completion          int
	Contents            []Content
	ContentsInfo        ContentsInfo
}

type Section

type Section struct {
	Id                  int
	Name                string
	Visible             int
	Summary             string
	SummaryFormat       int
	Section             int
	HiddenByNumSections int
	UserVisible         bool
	Modules             []Module
}

Jump to

Keyboard shortcuts

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