mirror of
https://github.com/Xevion/banner.git
synced 2025-12-11 10:06:36 -06:00
fix: provide doc comments for lints
This commit is contained in:
@@ -365,8 +365,8 @@ func GetInstructors(search string, term string, offset int, maxResults int) ([]I
|
|||||||
return instructors, nil
|
return instructors, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ClassDetails represents the details of a course.
|
||||||
// TODO: Finish this struct & function
|
// TODO: Finish this struct & function
|
||||||
// ClassDetails represents
|
|
||||||
type ClassDetails struct {
|
type ClassDetails struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ const (
|
|||||||
paramMaxResults = "pageMaxSize"
|
paramMaxResults = "pageMaxSize"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Query represents a search query for courses.
|
||||||
|
// It is a builder struct that allows for chaining of methods to build a query.
|
||||||
type Query struct {
|
type Query struct {
|
||||||
subject *string
|
subject *string
|
||||||
title *string
|
title *string
|
||||||
@@ -51,6 +53,7 @@ type Query struct {
|
|||||||
courseNumberRange *Range
|
courseNumberRange *Range
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewQuery creates a new Query with default values.
|
||||||
func NewQuery() *Query {
|
func NewQuery() *Query {
|
||||||
return &Query{maxResults: 8, offset: 0}
|
return &Query{maxResults: 8, offset: 0}
|
||||||
}
|
}
|
||||||
@@ -107,42 +110,50 @@ func (q *Query) InstructionalMethod(instructionalMethod []string) *Query {
|
|||||||
return q
|
return q
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Attributes sets the attributes for the query
|
||||||
func (q *Query) Attributes(attributes []string) *Query {
|
func (q *Query) Attributes(attributes []string) *Query {
|
||||||
q.attributes = &attributes
|
q.attributes = &attributes
|
||||||
return q
|
return q
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Instructor sets the instructors for the query
|
||||||
func (q *Query) Instructor(instructor []uint64) *Query {
|
func (q *Query) Instructor(instructor []uint64) *Query {
|
||||||
q.instructor = &instructor
|
q.instructor = &instructor
|
||||||
return q
|
return q
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StartTime sets the start time for the query
|
||||||
func (q *Query) StartTime(startTime time.Duration) *Query {
|
func (q *Query) StartTime(startTime time.Duration) *Query {
|
||||||
q.startTime = &startTime
|
q.startTime = &startTime
|
||||||
return q
|
return q
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EndTime sets the end time for the query
|
||||||
func (q *Query) EndTime(endTime time.Duration) *Query {
|
func (q *Query) EndTime(endTime time.Duration) *Query {
|
||||||
q.endTime = &endTime
|
q.endTime = &endTime
|
||||||
return q
|
return q
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Credits sets the credit range for the query
|
||||||
func (q *Query) Credits(low int, high int) *Query {
|
func (q *Query) Credits(low int, high int) *Query {
|
||||||
q.minCredits = &low
|
q.minCredits = &low
|
||||||
q.maxCredits = &high
|
q.maxCredits = &high
|
||||||
return q
|
return q
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MinCredits sets the minimum credits for the query
|
||||||
func (q *Query) MinCredits(value int) *Query {
|
func (q *Query) MinCredits(value int) *Query {
|
||||||
q.minCredits = &value
|
q.minCredits = &value
|
||||||
return q
|
return q
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MaxCredits sets the maximum credits for the query
|
||||||
func (q *Query) MaxCredits(value int) *Query {
|
func (q *Query) MaxCredits(value int) *Query {
|
||||||
q.maxCredits = &value
|
q.maxCredits = &value
|
||||||
return q
|
return q
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CourseNumbers sets the course number range for the query
|
||||||
func (q *Query) CourseNumbers(low int, high int) *Query {
|
func (q *Query) CourseNumbers(low int, high int) *Query {
|
||||||
q.courseNumberRange = &Range{low, high}
|
q.courseNumberRange = &Range{low, high}
|
||||||
return q
|
return q
|
||||||
@@ -160,6 +171,7 @@ func (q *Query) MaxResults(maxResults int) *Query {
|
|||||||
return q
|
return q
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Range represents a range of two integers.
|
||||||
type Range struct {
|
type Range struct {
|
||||||
Low int
|
Low int
|
||||||
High int
|
High int
|
||||||
|
|||||||
Reference in New Issue
Block a user