Documentation ¶
Index ¶
- func ClientCredentialsTokenSource(ctx context.Context, uid, secret string, scopes ...string) oauth2.TokenSource
- type Campus
- type Cursus
- type Doer
- type Helper
- func (h *Helper) CampusByID(ctx context.Context, id int) (*Campus, error)
- func (h *Helper) CampusByName(ctx context.Context, name string) (*Campus, error)
- func (h *Helper) DoGetFormJSON(ctx context.Context, path string, params url.Values, v interface{}) (*http.Response, error)
- func (h *Helper) PaginatedGet(ctx context.Context, method string, _form url.Values, receiverType interface{}) <-chan PaginatedSingleResult
- func (h *Helper) PaginatedGetLinkStyle(ctx context.Context, method string, _form url.Values, receiverType interface{}) <-chan PaginatedSingleResult
- func (h *Helper) ProjectByID(ctx context.Context, id int) (*Project, error)
- func (h *Helper) ProjectBySlug(ctx context.Context, slug string) (*Project, error)
- func (h *Helper) UserByID(ctx context.Context, id int) (*User, error)
- func (h *Helper) UserIDByLogin(ctx context.Context, login string) (int, error)
- type PaginatedSingleResult
- type Project
- type ProjectShort
- type ProjectUser
- type Skill
- type User
- type UserShort
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Campus ¶
type Campus struct { ID int `json:"id" lua:"id"` Name string `json:"name" lua:"name"` TimeZone string `json:"time_zone" lua:"time_zone"` Language struct { ID int `json:"id" lua:"id"` Name string `json:"name" lua:"name"` Identifier string `json:"identifier" lua:"identifier"` CreatedAt time.Time `json:"created_at" lua:"created_at"` UpdatedAt time.Time `json:"updated_at" lua:"updated_at"` } `json:"language" lua:"language"` UsersCount int `json:"users_count" lua:"users_count"` VogsphereID int `json:"vogsphere_id" lua:"vogsphere_id"` }
type Helper ¶
func (*Helper) CampusByID ¶
func (*Helper) CampusByName ¶
func (*Helper) DoGetFormJSON ¶
func (*Helper) PaginatedGet ¶
func (h *Helper) PaginatedGet(ctx context.Context, method string, _form url.Values, receiverType interface{}) <-chan PaginatedSingleResult
PaginatedGet loads all pages of Intra's response to the given query. Entries in params are overridden by query parameters contained in `method`. receiverType should be a pointer to the type of values you want in the result channel, but will not actually be used to store the result.
Any errors encountered will be the last value sent over the returned channel, and the returned channel will always be closed once all results have been sent.
func (*Helper) PaginatedGetLinkStyle ¶
func (h *Helper) PaginatedGetLinkStyle(ctx context.Context, method string, _form url.Values, receiverType interface{}) <-chan PaginatedSingleResult
PaginatedGet loads all pages of Intra's response to the given query. Entries in params are overridden by query parameters contained in `method`. receiverType should be a pointer to the type of values you want in the result channel, but will not actually be used to store the result.
Any errors encountered will be the last value sent over the returned channel, and the returned channel will always be closed once all results have been sent.
This works for endpoints that return data as {"data": [...], "links": {...}} .
func (*Helper) ProjectByID ¶
func (*Helper) ProjectBySlug ¶
type PaginatedSingleResult ¶
type Project ¶
type Project struct { ProjectShort Description string `json:"description"` Parent *ProjectShort `json:"parent"` Children []ProjectShort `json:"children"` Objectives []string `json:"objectives"` Tier int `json:"tier"` Attachments []interface{} `json:"attachments"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Exam bool `json:"exam"` Cursus []Cursus `json:"cursus"` Campus []Campus `json:"campus"` Skills []Skill `json:"skills"` Videos []interface{} `json:"videos"` Tags []struct { ID int `json:"id"` Name string `json:"name"` Kind string `json:"kind"` } `json:"tags"` ProjectSessions []struct { ID int `json:"id"` Solo bool `json:"solo"` BeginAt interface{} `json:"begin_at"` EndAt interface{} `json:"end_at"` EstimateTime int `json:"estimate_time"` DurationDays interface{} `json:"duration_days"` TerminatingAfter interface{} `json:"terminating_after"` ProjectID int `json:"project_id"` CampusID *int `json:"campus_id"` CursusID *int `json:"cursus_id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` MaxPeople interface{} `json:"max_people"` IsSubscriptable bool `json:"is_subscriptable"` Scales []struct { ID int `json:"id"` CorrectionNumber int `json:"correction_number"` IsPrimary bool `json:"is_primary"` } `json:"scales"` Uploads []struct { ID int `json:"id"` Name string `json:"name"` } `json:"uploads"` TeamBehaviour string `json:"team_behaviour"` } `json:"project_sessions"` }
type ProjectShort ¶
type ProjectUser ¶
type ProjectUser struct { ID int `json:"id" lua:"id"` Occurrence int `json:"occurrence" lua:"occurrence"` FinalMark int `json:"final_mark" lua:"final_mark"` Status string `json:"status" lua:"status"` Validated bool `json:"validated?" lua:"validated"` CurrentTeamID int `json:"current_team_id" lua:"current_team_id"` Project ProjectShort `json:"project" lua:"project"` CursusIds []int `json:"cursus_ids" lua:"cursus_ids"` User UserShort `json:"user" lua:"user"` Teams []struct { ID int `json:"id" lua:"id"` Name string `json:"name" lua:"name"` URL string `json:"url" lua:"url"` FinalMark int `json:"final_mark" lua:"final_mark"` ProjectID int `json:"project_id" lua:"project_id"` CreatedAt time.Time `json:"created_at" lua:"created_at"` UpdatedAt time.Time `json:"updated_at" lua:"updated_at"` Status string `json:"status" lua:"status"` TerminatingAt *time.Time `json:"terminating_at" lua:"terminating_at"` Users []struct { UserShort Leader bool `json:"leader" lua:"leader"` Occurrence int `json:"occurrence" lua:"occurrence"` Validated bool `json:"validated" lua:"validated"` ProjectsUserID int `json:"projects_user_id" lua:"projects_user_id"` } `json:"users" lua:"users"` Locked bool `json:"locked?" lua:"locked"` Validated bool `json:"validated?" lua:"validated"` Closed bool `json:"closed?" lua:"closed"` RepoURL string `json:"repo_url" lua:"repo_url"` RepoUUID string `json:"repo_uuid" lua:"repo_uuid"` LockedAt *time.Time `json:"locked_at" lua:"locked_at"` ClosedAt *time.Time `json:"closed_at" lua:"closed_at"` ProjectSessionID int `json:"project_session_id" lua:"project_session_id"` } `json:"teams" lua:"teams"` }
type User ¶
type User struct { Achievements []interface{} `json:"achievements"` Campus []struct { ID int `json:"id"` Language struct { CreatedAt time.Time `json:"created_at"` ID int `json:"id"` Identifier string `json:"identifier"` Name string `json:"name"` UpdatedAt time.Time `json:"updated_at"` } `json:"language"` Name string `json:"name"` TimeZone string `json:"time_zone"` UsersCount int `json:"users_count"` VogsphereID int `json:"vogsphere_id"` } `json:"campus"` CampusUsers []struct { CampusID int `json:"campus_id"` ID int `json:"id"` IsPrimary bool `json:"is_primary"` UserID int `json:"user_id"` } `json:"campus_users"` CorrectionPoint int `json:"correction_point"` CursusUsers []struct { BeginAt time.Time `json:"begin_at"` Cursus struct { CreatedAt time.Time `json:"created_at"` ID int `json:"id"` Name string `json:"name"` Slug string `json:"slug"` } `json:"cursus"` CursusID int `json:"cursus_id"` EndAt *time.Time `json:"end_at"` Grade string `json:"grade"` ID int `json:"id"` Level float64 `json:"level"` Skills []struct { ID int `json:"id"` Level float64 `json:"level"` Name string `json:"name"` } `json:"skills"` User struct { ID int `json:"id"` Login string `json:"login"` URL string `json:"url"` } `json:"user"` } `json:"cursus_users"` Displayname string `json:"displayname"` Email string `json:"email"` ExpertisesUsers []struct { ContactMe bool `json:"contact_me"` CreatedAt time.Time `json:"created_at"` ExpertiseID int `json:"expertise_id"` ID int `json:"id"` Interested bool `json:"interested"` UserID int `json:"user_id"` Value int `json:"value"` } `json:"expertises_users"` FirstName string `json:"first_name"` Groups []interface{} `json:"groups"` ID int `json:"id"` ImageURL string `json:"image_url"` LastName string `json:"last_name"` Location interface{} `json:"location"` Login string `json:"login"` Partnerships []interface{} `json:"partnerships"` Patroned []interface{} `json:"patroned"` Patroning []interface{} `json:"patroning"` Phone string `json:"phone"` PoolMonth string `json:"pool_month"` PoolYear string `json:"pool_year"` ProjectsUsers []struct { CurrentTeamID int `json:"current_team_id"` CursusIds []int `json:"cursus_ids"` FinalMark int `json:"final_mark"` ID int `json:"id"` Occurrence int `json:"occurrence"` Project struct { ID int `json:"id"` Name string `json:"name"` Slug string `json:"slug"` } `json:"project"` Status string `json:"status"` Validated bool `json:"validated?"` } `json:"projects_users"` Staff bool `json:"staff?"` Titles []interface{} `json:"titles"` URL string `json:"url"` Wallet int `json:"wallet"` }