apiv2

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 30 Imported by: 0

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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	protobuf.UnimplementedAPIServer
	// contains filtered or unexported fields
}

API is the grpc server for the v2 api

func New

func New(db *gorm.DB) *API

New creates a new API and assigns the given db and a logger

func (*API) AddBookmark

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

GetBookmarks retrieves bookmarks by stream ID.

func (*API) GetCourseBySlug

GetCourseBySlug retrieves a course by its slug, year, and term.

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) GetNotifications

func (a *API) GetNotifications(ctx context.Context, req *emptypb.Empty) (*protobuf.GetNotificationsResponse, error)

GetNotifications retrieves notifications for the current user.

func (*API) GetPinForCourse

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

GetProgressBatch returns a batch of watch progresses for a list of streams for the current user

func (*API) GetPublicCourses

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

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

func (a *API) GetUser(ctx context.Context, req *emptypb.Empty) (*protobuf.GetUserResponse, error)

GetUser retrieves the current user based on the context. It returns a GetUserResponse or an error if one occurs.

func (*API) GetUserCourses

GetUserCourses retrieves the courses for a user for a given semester.

func (*API) GetVideoSections

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

PinCourse pins or unpins a course for the user.

func (*API) Proxy

func (a *API) Proxy() func(c *gin.Context)

Proxy returns a gin handler that proxies requests to the grpc gateway server

func (*API) ResetPassword

ResetPassword resets the password for the user with the given username.

func (*API) Run

func (a *API) Run(lis net.Listener) error

Run starts the grpc server on port 12544 and the grpc gateway on ::8081/api/v2

func (*API) UpdateBookmark

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

UpdateUserSettings updates the profile settings for the current user.

type StreamRequest

type StreamRequest interface {
	GetStreamId() uint32
}

Jump to

Keyboard shortcuts

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