campus

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package campus collection of useful endpoints relating to campus, will hopefully offer: current term, are you on campus net, are you on the ystv net

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Campuser

type Campuser struct {
	// contains filtered or unexported fields
}

func (*Campuser) GetCurrentTerm

func (c *Campuser) GetCurrentTerm(ctx context.Context) (Term, error)

GetCurrentTerm returns the term as of the current time

func (*Campuser) GetCurrentWeek

func (c *Campuser) GetCurrentWeek(ctx context.Context) (Week, error)

GetCurrentWeek returns the week of the current time

func (*Campuser) GetTerm

func (c *Campuser) GetTerm(ctx context.Context, t time.Time) (Term, error)

GetTerm retrives an academic term for a given time

func (*Campuser) GetWeek

func (c *Campuser) GetWeek(ctx context.Context, t time.Time) (Week, error)

GetWeek retrives the week and it's term

type Term

type Term struct {
	TermID int       `db:"term_id" json:"termID"`
	Year   string    `db:"year" json:"year"`
	Term   string    `db:"term" json:"term"` // autumn / spring / summer
	Start  time.Time `db:"start" json:"start"`
	Finish time.Time `db:"finish" json:"finish"`
}

Term represents an academic term

type Week

type Week struct {
	Term   Term
	WeekNo int
}

Week is a normal week plus the number since the start of term

Jump to

Keyboard shortcuts

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