handshake

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 18 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package handshake reads events and career fairs from USC Handshake's student site and registers for career-fair sessions.

Index

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"`
	Sessions          []CareerFairSession `json:"sessions"`
	URL               string              `json:"url"`
}

CareerFairDetail is the complete student-facing career-fair record.

type CareerFairRegistration added in v0.1.1

type CareerFairRegistration struct {
	AttendeeID  int    `json:"attendee_id"`
	SessionID   int    `json:"session_id"`
	SessionName string `json:"session_name"`
	Registered  bool   `json:"registered"`
	Waitlisted  bool   `json:"waitlisted"`
}

CareerFairRegistration is the current user's attendance record for one career-fair session.

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 Category

type Category struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Slug string `json:"slug"`
}

Category is a Handshake event-search category.

type Client

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

Client calls Handshake with an authenticated session.

func New

func New(httpClient Doer) *Client

New creates a client from an authenticated HTTP client.

func Open

func Open(ctx context.Context, options auth.Options) (*Client, error)

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) CancelCareerFairSession added in v0.1.1

func (c *Client) CancelCareerFairSession(ctx context.Context, sessionID int) (CareerFairRegistration, error)

CancelCareerFairSession cancels the current user's registration or waitlist spot for a career-fair session. Cancelling an unregistered session succeeds.

func (*Client) CareerFair

func (c *Client) CareerFair(ctx context.Context, id int) (CareerFairDetail, error)

CareerFair returns the complete student-facing career-fair page by ID.

func (*Client) CareerFairs

func (c *Client) CareerFairs(ctx context.Context, search Search) (Page[CareerFairSummary], error)

CareerFairs returns one page of career fairs.

func (*Client) Categories

func (c *Client) Categories(ctx context.Context) ([]Category, error)

Categories returns Handshake's live event category vocabulary.

func (*Client) Event

func (c *Client) Event(ctx context.Context, id int) (EventDetail, error)

Event returns one complete event record by ID.

func (*Client) Events

func (c *Client) Events(ctx context.Context, search Search) (Page[EventSummary], error)

Events returns one page of student events.

func (*Client) RegisterCareerFairSession added in v0.1.1

func (c *Client) RegisterCareerFairSession(ctx context.Context, sessionID int) (CareerFairRegistration, error)

RegisterCareerFairSession registers the current user for a career-fair session, or waitlists them. Session IDs come from CareerFair.

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 Doer

type Doer interface {
	Do(*http.Request) (*http.Response, error)
}

Doer is the HTTP surface the client needs. auth.Session satisfies it.

type Employer

type Employer struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Industry string `json:"industry,omitempty"`
	Location string `json:"location,omitempty"`
}

Employer is an employer attached to an event or career fair.

type Error

type Error struct {
	Label  string
	Status int
	Body   string
}

Error is a Handshake request that failed with an HTTP status.

func (*Error) Error

func (e *Error) Error() string

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"`
}

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 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.

Jump to

Keyboard shortcuts

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