Documentation
¶
Overview ¶
Package handshake reads events and career fairs from USC Handshake's student site.
Index ¶
- type CareerFairDetail
- type CareerFairSession
- type CareerFairSummary
- type Category
- type Client
- func (c *Client) CareerFair(ctx context.Context, id int) (CareerFairDetail, error)
- func (c *Client) CareerFairs(ctx context.Context, search Search) (Page[CareerFairSummary], error)
- func (c *Client) Categories(ctx context.Context) ([]Category, error)
- func (c *Client) Event(ctx context.Context, id int) (EventDetail, error)
- func (c *Client) Events(ctx context.Context, search Search) (Page[EventSummary], error)
- type Contact
- type Doer
- type Employer
- type Error
- type EventDetail
- type EventSummary
- type Location
- type Organization
- type Page
- type Registration
- type Search
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CareerFairDetail ¶
type CareerFairDetail struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
DescriptionHTML string `json:"description_html"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
StartDate string `json:"start_date"`
EndDate string `json:"end_date"`
TimeZone string `json:"time_zone"`
Medium string `json:"medium"`
Location Location `json:"location"`
Institution Organization `json:"institution"`
Contact Contact `json:"contact"`
RegistrationStart string `json:"registration_start"`
RegistrationEnd string `json:"registration_end"`
RegistrationOpen bool `json:"registration_open"`
RegisteredCount int `json:"registered_count"`
CheckedInCount int `json:"checked_in_count"`
EmployerCount int `json:"employer_count"`
AvailableSpace *int `json:"available_space"`
WaitlistEnabled bool `json:"waitlist_enabled"`
InviteOnly bool `json:"invite_only"`
Public bool `json:"public"`
Status string `json:"status"`
ExternalLink string `json:"external_link,omitempty"`
Logo string `json:"logo,omitempty"`
Sessions []CareerFairSession `json:"sessions"`
URL string `json:"url"`
}
CareerFairDetail is the complete student-facing career-fair record.
type CareerFairSession ¶
type CareerFairSession struct {
ID int `json:"id"`
Name string `json:"name"`
StartDate string `json:"start_date"`
EndDate string `json:"end_date"`
TimeZone string `json:"time_zone"`
Type string `json:"type,omitempty"`
LocationType string `json:"location_type,omitempty"`
AvailableSpace *int `json:"available_space"`
ExternalLink string `json:"external_link,omitempty"`
RegistrationOpen bool `json:"registration_open"`
WaitlistEnabled bool `json:"waitlist_enabled"`
}
CareerFairSession is one component session of a career fair.
type CareerFairSummary ¶
type CareerFairSummary struct {
ID string `json:"id"`
Name string `json:"name"`
StartDate string `json:"start_date"`
EndDate string `json:"end_date"`
Medium string `json:"medium"`
Categories []Category `json:"categories"`
Host Organization `json:"host"`
Employers []Employer `json:"employers"`
Favorited bool `json:"favorited"`
Registered bool `json:"registered"`
SameSchoolHost bool `json:"same_school_host"`
RegistrationStart *string `json:"registration_start"`
RegistrationEnd *string `json:"registration_end"`
RegisteredAttendees int `json:"registered_attendees"`
URL string `json:"url"`
}
CareerFairSummary is one career-fair search result.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client calls Handshake with an authenticated session.
func Open ¶
Open signs in through USC SSO and returns an authenticated client. See auth.Options for supplying credentials and keeping the session between runs. It never prompts; authentication failures are *auth.SiteError values.
func (*Client) CareerFair ¶
CareerFair returns the complete student-facing career-fair page by ID.
func (*Client) CareerFairs ¶
CareerFairs returns one page of career fairs.
func (*Client) Categories ¶
Categories returns Handshake's live event category vocabulary.
type Contact ¶
type Contact struct {
ID string `json:"id"`
Name string `json:"name"`
Title string `json:"title,omitempty"`
Email string `json:"email,omitempty"`
Photo string `json:"photo,omitempty"`
}
Contact is an event organizer or contact.
type Employer ¶
type Employer struct {
ID string `json:"id"`
Name string `json:"name"`
Logo string `json:"logo,omitempty"`
Industry string `json:"industry,omitempty"`
Location string `json:"location,omitempty"`
}
Employer is an employer attached to an event or career fair.
type EventDetail ¶
type EventDetail struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
DescriptionHTML string `json:"description_html"`
StartDate string `json:"start_date"`
EndDate string `json:"end_date"`
TimeZone string `json:"time_zone"`
EventType string `json:"event_type"`
Medium string `json:"medium"`
Location Location `json:"location"`
Owner Organization `json:"owner"`
Host Organization `json:"host"`
Categories []Category `json:"categories"`
Contacts []Contact `json:"contacts"`
Employers []Employer `json:"employers"`
Registration *Registration `json:"registration,omitempty"`
RegistrationStart *string `json:"registration_start"`
RegistrationEnd *string `json:"registration_end"`
AvailableSpace *int `json:"available_space"`
WaitlistEnabled bool `json:"waitlist_enabled"`
WaitlistedCount int `json:"waitlisted_count"`
RegisteredAttendees int `json:"registered_attendees"`
VirtualLink *string `json:"virtual_link"`
ExternalLink *string `json:"external_link"`
ExternalRegistration bool `json:"external_registration"`
LegalDisclaimer string `json:"legal_disclaimer,omitempty"`
Image string `json:"image,omitempty"`
URL string `json:"url"`
}
EventDetail is the complete student-facing event record.
type EventSummary ¶
type EventSummary struct {
ID string `json:"id"`
Name string `json:"name"`
StartDate string `json:"start_date"`
EndDate string `json:"end_date"`
Medium string `json:"medium"`
Categories []Category `json:"categories"`
Host Organization `json:"host"`
Employers []Employer `json:"employers"`
Favorited bool `json:"favorited"`
Registered bool `json:"registered"`
SameSchoolHost bool `json:"same_school_host"`
SameSchoolEvent bool `json:"same_school_event"`
RegistrationStart *string `json:"registration_start"`
RegistrationEnd *string `json:"registration_end"`
RegisteredAttendees int `json:"registered_attendees"`
URL string `json:"url"`
}
EventSummary is one event-search result. Event returns the full record, including its type and contacts.
type Location ¶
type Location struct {
Name string `json:"name"`
Building string `json:"building,omitempty"`
Room string `json:"room,omitempty"`
City string `json:"city,omitempty"`
State string `json:"state,omitempty"`
Country string `json:"country,omitempty"`
Latitude *float64 `json:"latitude,omitempty"`
Longitude *float64 `json:"longitude,omitempty"`
}
Location is a normalized event or career-fair location.
type Organization ¶
type Organization struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type,omitempty"`
Logo string `json:"logo,omitempty"`
}
Organization identifies an event host or owner.
type Page ¶
type Page[T any] struct { Items []T `json:"items"` HasMore bool `json:"has_more"` NextCursor string `json:"next_cursor,omitempty"` CursorKind string `json:"cursor_kind"` Sort string `json:"sort"` }
Page is one result page. Pass NextCursor as Search.After, with the same filters and sort, to read the next one.
type Registration ¶
type Registration struct {
Registered bool `json:"registered"`
Registering bool `json:"registering"`
Waitlisted bool `json:"waitlisted"`
CheckedIn bool `json:"checked_in"`
}
Registration summarizes the current user's event registration state.
type Search ¶
type Search struct {
Categories []string // names, slugs, or IDs from Categories
Organizer string // host, employer, or contact name or email
Keyword string
Medium string // all, virtual, or in-person
Date string // all, today, next-10, next-30, or past-year
Sort string // relevance, date, or posted-desc
PostedBySchool bool
Limit int // 1-100; 0 means 30
After string // NextCursor of the previous page
}
Search filters and orders an event or career-fair list. The zero value is the first 30 results by relevance.