Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlueprintParams ¶
type BlueprintParams struct { PageParams SemesterParams Units int `query:"units" form:"units"` }
BlueprintParams is the set of parameters for the blueprint query.
type Course ¶
type Course struct { Entry Exam Exam `db:"exam" json:"exam"` Subcourses SubCourseList `db:"subcourses" json:"subcourses"` }
Course is a course
type CourseBlueprint ¶
type CourseBlueprint struct { Subject string `db:"subject" json:"subject"` CourseNum int `db:"course_num" json:"course_num"` Title string `db:"title" json:"title"` MinUnits int `db:"min_units" json:"min_units"` MaxUnits int `db:"max_units" json:"max_units"` Enrolled int `db:"enrolled" json:"enrolled"` Capacity int `db:"capacity" json:"capacity"` Percent float64 `db:"percent" json:"percent"` CRNs pq.Int32Array `db:"crns" json:"crns"` IDs pq.Int32Array `db:"ids" json:"ids"` Count int `db:"count" json:"count"` }
CourseBlueprint is an overview of all of the instances of one course. It tells what the course subject and number are and contains a list of IDs that point to spesific instances of the course.
func GetBlueprints ¶
func GetBlueprints(params *BlueprintParams) ([]*CourseBlueprint, error)
GetBlueprints will
type Entry ¶
type Entry struct { ID int `db:"id" json:"id" csv:"-"` CRN int `db:"crn" json:"crn"` Subject string `db:"subject" json:"subject"` CourseNum int `db:"course_num" json:"course_num"` Type string `db:"type" json:"type"` Title string `db:"title" json:"title"` Units int `db:"units" json:"units" csv:"units"` Days Weekdays `db:"days" json:"days" csv:"days" goqu:"skipinsert"` Description string `db:"description" json:"description"` Capacity int `db:"capacity" json:"capacity"` Enrolled int `db:"enrolled" json:"enrolled"` Remaining int `db:"remaining" json:"remaining"` UpdatedAt time.Time `db:"updated_at" json:"updated_at" csv:"-" goqu:"skipupdate,skipinsert"` Year int `db:"year" json:"year" csv:"year"` TermID int `db:"term_id" json:"term_id" csv:"term_id"` }
Entry is an entry in the catalog
type Exam ¶
type Exam struct { Date time.Time `db:"date" json:"date"` StartTime time.Time `db:"start_time" json:"start_time"` EndTime time.Time `db:"end_time" json:"end_time"` }
Exam is an exam
type PageParams ¶
type PageParams struct { Limit *uint `form:"limit" query:"limit" db:"limit"` Offset *uint `form:"offset" query:"offset" db:"offset"` }
PageParams are url params for api pagination
func (*PageParams) AppendSelect ¶
func (pp *PageParams) AppendSelect(stmt *goqu.SelectDataset) *goqu.SelectDataset
AppendSelect appends the parameters to a generated sql query statement
func (*PageParams) Clone ¶
func (pp *PageParams) Clone() goqu.Expression
Clone implements the goqu.Expression interface
func (*PageParams) Expression ¶
func (pp *PageParams) Expression() goqu.Expression
Expression implements the goqu.Expression interface
type SemesterParams ¶
type SemesterParams struct { Year int `form:"year" uri:"year" query:"year" db:"year"` Term string `form:"term" uri:"term" query:"term" db:"term_id"` Subject string `form:"subject" query:"subject" db:"subject"` }
SemesterParams is a structure that defines parameters that control which courses are returned from a query
func (*SemesterParams) Bind ¶
func (sp *SemesterParams) Bind(c *gin.Context) (err error)
Bind will bind a request to the params
func (*SemesterParams) Clone ¶
func (sp *SemesterParams) Clone() goqu.Expression
Clone implements the goqu.Expression interface
func (*SemesterParams) Expression ¶
func (sp *SemesterParams) Expression() goqu.Expression
Expression implements the goqu.Expression interface
type SubCourse ¶
type SubCourse struct { CRN int `db:"crn" json:"crn"` CourseCRN int `db:"course_crn" json:"course_crn"` Section string `db:"section" json:"section"` StartTime time.Time `db:"start_time" json:"start_time,omitempty"` EndTime time.Time `db:"end_time" json:"end_time,omitempty"` Building string `db:"building_room" json:"building_room"` InstructorID int64 `db:"instructor_id" json:"instructor_id"` UpdatedAt time.Time `db:"updated_at" json:"updated_at" csv:"-" goqu:"skipupdate,skipinsert"` Enrolled int `db:"enrolled" json:"enrolled"` Capacity int `db:"capacity" json:"capacity"` Remaining int `db:"remaining" json:"remaining"` Days Weekdays `db:"days" json:"days"` }
SubCourse is an auxillary course that is meant to be taken along side some other main course
type SubCourseList ¶
type SubCourseList []SubCourse
SubCourseList is a list of SubCourses that maintains interoperability with postgresql json blobs.
func (*SubCourseList) Scan ¶
func (sc *SubCourseList) Scan(val interface{}) error
Scan will convert the list of subcourses from json to a serialized struct slice.
type Weekday ¶
type Weekday string
Weekday is a weekday
const ( Sunday Weekday = "sunday" Monday Weekday = "monday" Tuesday Weekday = "tuesday" Wednesday Weekday = "wednesday" Thursday Weekday = "thursday" Friday Weekday = "friday" Saturday Weekday = "saturday" )
These are all weekday values
func NewWeekdays ¶
NewWeekdays will convert a slice of time.Weekday to []catalog.Weekday
func WeekdayFromTimePkg ¶
WeekdayFromTimePkg will create a new Weekday from a time.Weekdays