course

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package course reads a course of the module format and checks it as the format says: the file by the YAML rules, the format version it names, its schema and the rule of its grades. A course joins modules, one for each school grade, into one line of learning; it is no part of a module, and the module index holds its value. The CLI's check-course and index call it.

Index

Constants

View Source
const RuleGrades = "course.grades"

RuleGrades is the rule of a course that its schema cannot say: its grades stand in ascending order, no grade twice, and no module stands at two grades.

Variables

View Source
var Rules = []string{RuleGrades}

Rules lists the rules of a course, in the order the format lists them.

Functions

func Breaches

func Breaches(c formatv0.Course) []module.Breach

Breaches gives what a course that its schema accepts breaks of course.grades: the first grade that does not stand above the one before it, or the first module that stands at a grade already.

func Check

func Check(data []byte) (module.Report, error)

Check reads a course file and checks it by the format version module-kit reads: by the YAML rules, by the format version it names, against course.schema.json and by course.grades. A course that names a version module-kit does not read breaks manifest.format-version alone, as a manifest does, since the rest of it is written by rules module-kit does not know. Its breaches have no path, as those of module.CheckFile; the caller names the file. The error is for a file that the reader of YAML cannot read, though the format may accept it.

func Read

func Read(data []byte) (formatv0.Course, module.Report, error)

Read is Check, and gives besides the course when the report has no breach: the value of its file as it is, with no default filled in, as the module index holds it. The breaches stand in the order of their places — the line and column, then the value, member by member —, and at one place in the order of their rules, keywords and messages, so that the report is the same on every run.

Types

This section is empty.

Jump to

Keyboard shortcuts

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