parser

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: MIT Imports: 4 Imported by: 0

README

Optivum Timetable Parser

Nieoficjalny parser planów lekcji z generatora Optivum.

Instalacja

go get github.com/terawatthour/optivum-timetable-parser

Użytkowanie

import (
    "fmt"
    parser "github.com/terawatthour/optivum-timetable-parser"
)

func main() {
    tt := parser.NewTimetable([]byte("content"))
    if err := tt.Parse(); err != nil {
        panic(err)
    }

    fmt.Println(tt.LessonsByDay())
}

Licencja

TeraWattHour 2022-
Licencja MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lesson

type Lesson struct {
	Day       string `json:"day"`
	HourIndex string `json:"hourIndex"`
	Hour      string `json:"hour"`
	Subject   string `json:"subject"`
	Teacher   string `json:"teacher,omitempty"`
	Classroom string `json:"classroom,omitempty"`
}

Lesson represents a lesson instance, this type is uniform across the whole package.

type Timetable

type Timetable interface {
	Parse() error
	LessonsMatrix() TimetableMatrix
	LessonsByDay() TimetableByDay
}

func NewTimetable

func NewTimetable(content []byte) Timetable

Use this function to initialize a Timetable. To use the created instance, parse its content using the Parse method.

type TimetableByDay

type TimetableByDay map[string][][]*Lesson

type TimetableMatrix

type TimetableMatrix [][][]*Lesson

Jump to

Keyboard shortcuts

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