chsuapi

package
v0.0.0-...-4f39408 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const URL = "http://api.chsu.ru/api/"

Variables

View Source
var ErrInvalidToken = errors.New("Invalid token")
View Source
var ErrManyRedirects = errors.New("More 10 redirects, need to get auth token")

Functions

This section is empty.

Types

type API

type API struct {
	Data   map[string]string
	Token  string
	Client *http.Client
	// contains filtered or unexported fields
}

func New

func New(data map[string]string, logger *logging.Logger) *API

func (*API) All

func (a *API) All() ([]schedule.Lecture, error)

func (*API) GroupsId

func (a *API) GroupsId() ([]GroupIds, error)

func (*API) One

func (a *API) One(startDate, endDate string, groupId int) ([]schedule.Lecture, error)

type GroupIds

type GroupIds struct {
	Id    int
	Title string
}

type Token

type Token struct {
	Data  string `json:"data"`
	Error struct {
		Code        int    `json:"code"`
		Status      string `json:"status"`
		Description string `json:"description"`
	}
}

Jump to

Keyboard shortcuts

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