Documentation
¶
Overview ¶
Package apiv2 provides API endpoints for the application.
Package apiv2 provides API endpoints for the application.
Package apiv2 provides API endpoints for the application.
Package apiv2 provides API endpoints for the application.
Index ¶
- Variables
- func MetricsHandler() http.Handler
- type API
- func (a *API) AddBookmark(ctx context.Context, req *protobuf.AddBookmarkRequest) (*protobuf.AddBookmarkResponse, error)
- func (a *API) DeleteBookmark(ctx context.Context, req *protobuf.DeleteBookmarkRequest) (*emptypb.Empty, error)
- func (a *API) ExportPersonalData(ctx context.Context, req *emptypb.Empty) (*protobuf.ExportPersonalDataResponse, error)
- func (a *API) GetBookmarks(ctx context.Context, req *protobuf.GetBookmarksRequest) (*protobuf.GetBookmarksResponse, error)
- func (a *API) GetCourseBySlug(ctx context.Context, req *protobuf.GetCourseBySlugRequest) (*protobuf.GetCourseBySlugResponse, error)
- func (a *API) GetFrontendConfig(ctx context.Context, req *emptypb.Empty) (*protobuf.GetFrontendConfigResponse, error)
- func (a *API) GetLiveCourses(ctx context.Context, req *emptypb.Empty) (*protobuf.GetLiveCoursesResponse, error)
- func (a *API) GetLoginOptions(ctx context.Context, req *emptypb.Empty) (*protobuf.GetLoginOptionsResponse, error)
- func (a *API) GetNotifications(ctx context.Context, req *emptypb.Empty) (*protobuf.GetNotificationsResponse, error)
- func (a *API) GetPinForCourse(ctx context.Context, req *protobuf.GetPinForCourseRequest) (*protobuf.GetPinForCourseResponse, error)
- func (a *API) GetPinnedCourses(ctx context.Context, req *emptypb.Empty) (*protobuf.GetPinnedCoursesResponse, error)
- func (a *API) GetProgressBatch(ctx context.Context, req *protobuf.GetProgressBatchRequest) (*protobuf.GetProgressBatchResponse, error)
- func (a *API) GetPublicCourses(ctx context.Context, req *protobuf.GetPublicCoursesRequest) (*protobuf.GetPublicCoursesResponse, error)
- func (a *API) GetSemesters(ctx context.Context, req *emptypb.Empty) (*protobuf.GetSemestersResponse, error)
- func (a *API) GetServerNotifications(ctx context.Context, req *emptypb.Empty) (*protobuf.GetServerNotificationsResponse, error)
- func (a *API) GetStream(ctx context.Context, req *protobuf.GetStreamRequest) (*protobuf.CourseStream, error)
- func (a *API) GetStreamPlaylist(ctx context.Context, req *protobuf.GetStreamPlaylistRequest) (*protobuf.GetStreamPlaylistResponse, error)
- func (a *API) GetSubtitles(ctx context.Context, req *protobuf.GetSubtitlesRequest) (*httpbody.HttpBody, error)
- func (a *API) GetThumbs(ctx context.Context, req *protobuf.GetThumbsRequest) (*httpbody.HttpBody, error)
- func (a *API) GetUser(ctx context.Context, req *emptypb.Empty) (*protobuf.GetUserResponse, error)
- func (a *API) GetUserCourses(ctx context.Context, req *protobuf.GetUserCoursesRequest) (*protobuf.GetUserCoursesResponse, error)
- func (a *API) GetVideoSections(ctx context.Context, req *protobuf.GetVideoSectionsRequest) (*protobuf.GetVideoSectionsResponse, error)
- func (a *API) HealthCheck(ctx context.Context, req *emptypb.Empty) (*protobuf.HealthCheckResponse, error)
- func (a *API) PinCourse(ctx context.Context, req *protobuf.PinCourseRequest) (*protobuf.PinCourseResponse, error)
- func (a *API) Proxy() func(c *gin.Context)
- func (a *API) ResetPassword(ctx context.Context, req *protobuf.ResetPasswordRequest) (*protobuf.ResetPasswordResponse, error)
- func (a *API) Run(lis net.Listener) error
- func (a *API) UpdateBookmark(ctx context.Context, req *protobuf.UpdateBookmarkRequest) (*protobuf.UpdateBookmarkResponse, error)
- func (a *API) UpdateProgress(ctx context.Context, req *protobuf.UpdateProgressRequest) (*protobuf.StreamProgress, error)
- func (a *API) UpdateUserSettings(ctx context.Context, req *protobuf.UpdateUserSettingsRequest) (*protobuf.UpdateUserSettingsResponse, error)
- type StreamRequest
Constants ¶
This section is empty.
Variables ¶
var ErrNoCredentials = errors.New("no credentials presented")
ErrNoCredentials means nothing was presented to authenticate with, as opposed to something presented and rejected. On endpoints serving anonymous callers the first answers normally and the second is an expired token that needs a 401 to refresh.
Functions ¶
func MetricsHandler ¶ added in v1.7.10
MetricsHandler serves the Prometheus exposition format for everything registered on the default registry, the gRPC server metrics included.
Types ¶
type API ¶
type API struct {
protobuf.UnimplementedMetaServiceServer
protobuf.UnimplementedUserServiceServer
protobuf.UnimplementedCourseServiceServer
protobuf.UnimplementedStreamServiceServer
// contains filtered or unexported fields
}
API is the grpc server for the v2 api. It implements all four services, which are split for grouping rather than to be deployed apart: one process, one gateway mux, one set of interceptors.
func (*API) AddBookmark ¶
func (a *API) AddBookmark(ctx context.Context, req *protobuf.AddBookmarkRequest) (*protobuf.AddBookmarkResponse, error)
AddBookmark adds a new bookmark.
func (*API) DeleteBookmark ¶
func (a *API) DeleteBookmark(ctx context.Context, req *protobuf.DeleteBookmarkRequest) (*emptypb.Empty, error)
DeleteBookmark deletes a bookmark.
func (*API) ExportPersonalData ¶
func (a *API) ExportPersonalData(ctx context.Context, req *emptypb.Empty) (*protobuf.ExportPersonalDataResponse, error)
ExportPersonalData exports the personal data of the current user.
func (*API) GetBookmarks ¶
func (a *API) GetBookmarks(ctx context.Context, req *protobuf.GetBookmarksRequest) (*protobuf.GetBookmarksResponse, error)
GetBookmarks retrieves bookmarks by stream ID.
func (*API) GetCourseBySlug ¶
func (a *API) GetCourseBySlug(ctx context.Context, req *protobuf.GetCourseBySlugRequest) (*protobuf.GetCourseBySlugResponse, error)
GetCourseBySlug retrieves a course by its slug, year, and term.
func (*API) GetFrontendConfig ¶ added in v1.7.10
func (a *API) GetFrontendConfig(ctx context.Context, req *emptypb.Empty) (*protobuf.GetFrontendConfigResponse, error)
GetFrontendConfig returns what the frontend needs to render its shell: branding, version and footer links. Public, because the shell renders before anyone signs in. Nothing in it is per-user.
func (*API) GetLiveCourses ¶
func (a *API) GetLiveCourses(ctx context.Context, req *emptypb.Empty) (*protobuf.GetLiveCoursesResponse, error)
GetLiveCourses retrieves the currently live courses and their streams.
func (*API) GetLoginOptions ¶ added in v1.7.10
func (a *API) GetLoginOptions(ctx context.Context, req *emptypb.Empty) (*protobuf.GetLoginOptionsResponse, error)
GetLoginOptions reports which login methods this deployment offers, so that a client can render the right controls before anyone has authenticated.
func (*API) GetNotifications ¶
func (a *API) GetNotifications(ctx context.Context, req *emptypb.Empty) (*protobuf.GetNotificationsResponse, error)
GetNotifications retrieves notifications for the current user.
func (*API) GetPinForCourse ¶
func (a *API) GetPinForCourse(ctx context.Context, req *protobuf.GetPinForCourseRequest) (*protobuf.GetPinForCourseResponse, error)
GetPinForCourse checks if the user has pinned the course.
func (*API) GetPinnedCourses ¶
func (a *API) GetPinnedCourses(ctx context.Context, req *emptypb.Empty) (*protobuf.GetPinnedCoursesResponse, error)
GetPinnedCourses retrieves the pinned courses for a user.
func (*API) GetProgressBatch ¶
func (a *API) GetProgressBatch(ctx context.Context, req *protobuf.GetProgressBatchRequest) (*protobuf.GetProgressBatchResponse, error)
GetProgressBatch returns a batch of watch progresses for a list of streams for the current user
func (*API) GetPublicCourses ¶
func (a *API) GetPublicCourses(ctx context.Context, req *protobuf.GetPublicCoursesRequest) (*protobuf.GetPublicCoursesResponse, error)
GetPublicCourses retrieves the public courses for a given semester.
func (*API) GetSemesters ¶
func (a *API) GetSemesters(ctx context.Context, req *emptypb.Empty) (*protobuf.GetSemestersResponse, error)
GetSemesters retrieves all available semesters and the current semester.
func (*API) GetServerNotifications ¶
func (a *API) GetServerNotifications(ctx context.Context, req *emptypb.Empty) (*protobuf.GetServerNotificationsResponse, error)
GetServerNotifications retrieves current server notifications.
func (*API) GetStream ¶
func (a *API) GetStream(ctx context.Context, req *protobuf.GetStreamRequest) (*protobuf.CourseStream, error)
GetStream returns a stream by its ID including the course and lecture hall
func (*API) GetStreamPlaylist ¶
func (a *API) GetStreamPlaylist(ctx context.Context, req *protobuf.GetStreamPlaylistRequest) (*protobuf.GetStreamPlaylistResponse, error)
GetStreamPlaylist returns the playlist for a stream
func (*API) GetSubtitles ¶
func (a *API) GetSubtitles(ctx context.Context, req *protobuf.GetSubtitlesRequest) (*httpbody.HttpBody, error)
GetSubtitles returns the subtitles for a stream in a specific language
func (*API) GetThumbs ¶
func (a *API) GetThumbs(ctx context.Context, req *protobuf.GetThumbsRequest) (*httpbody.HttpBody, error)
GetThumbs returns the thumbnails for a stream
func (*API) GetUser ¶
GetUser retrieves the current user based on the context. It returns a GetUserResponse or an error if one occurs.
func (*API) GetUserCourses ¶
func (a *API) GetUserCourses(ctx context.Context, req *protobuf.GetUserCoursesRequest) (*protobuf.GetUserCoursesResponse, error)
GetUserCourses retrieves the courses for a user for a given semester.
func (*API) GetVideoSections ¶
func (a *API) GetVideoSections(ctx context.Context, req *protobuf.GetVideoSectionsRequest) (*protobuf.GetVideoSectionsResponse, error)
GetVideoSections returns a list of video sections for a stream
func (*API) HealthCheck ¶
func (a *API) HealthCheck(ctx context.Context, req *emptypb.Empty) (*protobuf.HealthCheckResponse, error)
HealthCheck returns ok
func (*API) PinCourse ¶
func (a *API) PinCourse(ctx context.Context, req *protobuf.PinCourseRequest) (*protobuf.PinCourseResponse, error)
PinCourse pins or unpins a course for the user.
func (*API) ResetPassword ¶
func (a *API) ResetPassword(ctx context.Context, req *protobuf.ResetPasswordRequest) (*protobuf.ResetPasswordResponse, error)
ResetPassword resets the password for the user with the given username.
func (*API) UpdateBookmark ¶
func (a *API) UpdateBookmark(ctx context.Context, req *protobuf.UpdateBookmarkRequest) (*protobuf.UpdateBookmarkResponse, error)
UpdateBookmark updates an existing bookmark.
func (*API) UpdateProgress ¶
func (a *API) UpdateProgress(ctx context.Context, req *protobuf.UpdateProgressRequest) (*protobuf.StreamProgress, error)
UpdateProgress updates the watch progress for a stream
func (*API) UpdateUserSettings ¶
func (a *API) UpdateUserSettings(ctx context.Context, req *protobuf.UpdateUserSettingsRequest) (*protobuf.UpdateUserSettingsResponse, error)
UpdateUserSettings updates the profile settings for the current user.
type StreamRequest ¶
type StreamRequest interface {
GetStreamId() uint32
}