package module
v0.1.0 Latest Latest

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

Go to latest
Published: Apr 14, 2023 License: MIT Imports: 16 Imported by: 0




This section is empty.


View Source
var (
	ErrCredentials = errors.New("wrong username or password")
	ErrToken       = errors.New("token could not be found")
	ErrFullName    = errors.New("full name could not be found")
	ErrUpdate      = errors.New("update failed")
	ErrFileHash    = errors.New("file hash could not be found")


This section is empty.


type AuthService

type AuthService service

func (*AuthService) Login

func (auth *AuthService) Login(username string, password string) (*User, error)

type Client

type Client struct {

	// The current user's login name.
	User *User

	// Base URL for requests. Should end with a dash.
	BaseURL *url.URL

	// Host field set within request headers
	Host string

	Auth     *AuthService
	Exercise *ExerciseService
	Members  *MemberService
	// contains filtered or unexported fields

func NewClient

func NewClient(client *http.Client, credentials *Credentials) (*Client, error)

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

func (*Client) NewMultipartRequest

func (c *Client) NewMultipartRequest(method string, path string, body url.Values, upload *UploadFile) (*http.Request, error)

func (*Client) NewRequest

func (c *Client) NewRequest(method string, path string, body url.Values) (*http.Request, error)

type CommentParams

type CommentParams struct {
	Reference  string `schema:"ref_id"`
	Assignment string `schema:"ass_id"`

type Correction

type Correction struct {
	Student    string  `yaml:"student"`
	Points     float64 `yaml:"points"`
	Corrected  bool    `yaml:"corrected"`
	Correction string  `yaml:"correction,flow"`

type CourseMember

type CourseMember struct {
	Identifier string
	Username   string
	Firstname  string
	Lastname   string
	Role       string

func (*CourseMember) ToRow

func (s *CourseMember) ToRow() []string

type Credentials

type Credentials struct {
	Username string
	Password string

type DownloadParams

type DownloadParams struct {
	Reference  string `schema:"ref_id"`
	Assignment string `schema:"ass_id"`
	Member     string `schema:"member_id"`

type ExerciseService

type ExerciseService service

func (*ExerciseService) Download

func (exercise *ExerciseService) Download(params *DownloadParams) (*Submission, error)

func (*ExerciseService) Export

func (exercise *ExerciseService) Export(query *GradesExportQuery) ([]Grading, error)

func (*ExerciseService) List

func (exercise *ExerciseService) List(params *ListParams) ([]SubmissionMeta, error)

func (*ExerciseService) UpdateComment

func (exercise *ExerciseService) UpdateComment(params *CommentParams, correction Correction) error

func (*ExerciseService) UpdateGrades

func (exercise *ExerciseService) UpdateGrades(params *GradesUpdateQuery, corrections []Correction) error

type GradesExportQuery

type GradesExportQuery struct {
	Reference string `schema:"ref_id"`

type GradesUpdateQuery

type GradesUpdateQuery struct {
	Reference  string `schema:"ref_id"`
	Assignment string `schema:"ass_id"`
	Token      string `schema:"rtoken"`

type Grading

type Grading struct {
	Id       string
	Forename string
	Surname  string
	Grades   []string

func (*Grading) ToHeader

func (grading *Grading) ToHeader() []string

func (*Grading) ToRow

func (grading *Grading) ToRow() []string

type ListParams

type ListParams struct {
	Reference    string `schema:"ref_id"`
	Assignment   string `schema:"ass_id"`
	IncludeEmpty bool   `schema:"-"`

type MemberParams

type MemberParams struct {
	Reference string `schema:"ref_id"`

type MemberService

type MemberService service

func (*MemberService) List

func (members *MemberService) List(params *MemberParams) ([]CourseMember, error)

type Submission

type Submission struct {
	ContentType string
	Content     []byte

type SubmissionMeta

type SubmissionMeta struct {
	Identifier string
	Firstname  string
	Lastname   string
	UserId     string
	Date       string

func (*SubmissionMeta) ToRow

func (s *SubmissionMeta) ToRow() []string

type UploadFile

type UploadFile struct {
	Header  textproto.MIMEHeader
	Content *bytes.Buffer

type User

type User struct {
	Username string `schema:"-"`
	Token    string `schema:"rtoken"`

Jump to

Keyboard shortcuts

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