Documentation ¶
Index ¶
Constants ¶
View Source
const NoDeadline = "Χωρίς προθεσμία"
Variables ¶
This section is empty.
Functions ¶
func SortByDeadline ¶
func SortByDeadline(a []Assignment)
SortByDeadline function sorts assignments by descending deadline
Types ¶
type Assignment ¶
type Assignment struct { ID string Course *course.Course Title string Deadline *time.Time IsSent bool }
func (Assignment) IsExcluded ¶
func (a Assignment) IsExcluded( opts config.Options, courseID string, location *time.Location, ) bool
IsExcluded method determines if the assignment should be excluded from final result
func (*Assignment) PrepareURL ¶
func (a *Assignment) PrepareURL(baseURL string) (string, error)
PrepareURL method prepares URL for assignments' own page
func (*Assignment) String ¶
func (a *Assignment) String() string
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) FetchAssignments ¶
func (svc *Service) FetchAssignments(ctx context.Context) ([]Assignment, error)
FetchAssignments method will retrieve all assignments of your assignments and filter them out based on Service's options.
1. retrieves enrolled courses,
2. concurrently fans-out each course's http request + assignment scrapping through channels,
3. fans-in channels' result into one,
4. sorts them by deadline
Click to show internal directories.
Click to hide internal directories.