grpcserver

package
v0.0.0-...-831c856 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: BSD-2-Clause Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const NUM_TRANSCODING_WORKERS = 1

Variables

View Source
var DailyUploadLimitError error = errors.New("the daily upload limit has been exceeded")

Functions

func LogAndRetErr

func LogAndRetErr(fmtStr string, err error) error

func NewGRPCServer

func NewGRPCServer(bucketName string, db *sqlx.DB, port int, originFQDN string, local bool,
	client userproto.UserServiceClient, tracer opentracing.Tracer, storageBackend, apiID,
	apiKey string, approvalThreshold int, storageEndpoint string, MaxDLFileSize int64, redisConn *redis.Client, maxDailyUploadMB int) error

TODO: API is getting bloated

Types

type GRPCServer

type GRPCServer struct {
	VideoModel *models.VideoModel
	Local      bool
	OriginFQDN string
	Storage    storage.Storage
	RedisConn  *redis.Client
	proto.UnsafeVideoServiceServer
	MaxDailyUploadMB int
}

func (GRPCServer) AddDanmaku

func (g GRPCServer) AddDanmaku(ctx context.Context, req *proto.Danmaku) (*proto.Nothing, error)

func (GRPCServer) ApproveVideo

func (g GRPCServer) ApproveVideo(ctx context.Context, req *proto.VideoApproval) (*proto.Nothing, error)

func (GRPCServer) DeleteComment

func (g GRPCServer) DeleteComment(ctx context.Context, req *proto.CommentDeletionReq) (*proto.Nothing, error)

func (GRPCServer) DeleteVideo

func (g GRPCServer) DeleteVideo(ctx context.Context, deleteReq *proto.VideoDeletionReq) (*proto.Nothing, error)

TODO: note that this method only works for the basic method of encoding, and not for any form of transcoding

func (GRPCServer) DownloadVideo

func (g GRPCServer) DownloadVideo(req *proto.VideoRequest, outputStream proto.VideoService_DownloadVideoServer) error

Do we need this?

func (GRPCServer) ForeignVideoExists

func (g GRPCServer) ForeignVideoExists(ctx context.Context, foreignVideoCheck *proto.ForeignVideoCheck) (*proto.VideoExistenceResponse, error)

func (GRPCServer) GetCategories

func (g GRPCServer) GetCategories(context.Context, *proto.Nothing) (*proto.CategoryList, error)

func (GRPCServer) GetCommentsForVideo

func (g GRPCServer) GetCommentsForVideo(ctx context.Context, commentListReq *proto.CommentRequest) (*proto.CommentListResponse, error)

func (GRPCServer) GetDanmaku

func (g GRPCServer) GetDanmaku(ctx context.Context, req *proto.DanmakuQueryReq) (*proto.DanmakuList, error)

func (GRPCServer) GetFollowFeed

func (g GRPCServer) GetFollowFeed(ctx context.Context, req *proto.FeedReq) (*proto.VideoList, error)

func (GRPCServer) GetVideo

func (GRPCServer) GetVideoList

func (g GRPCServer) GetVideoList(ctx context.Context, queryConfig *proto.VideoQueryConfig) (*proto.VideoList, error)

func (GRPCServer) GetVideoRecommendations

func (g GRPCServer) GetVideoRecommendations(ctx context.Context, req *proto.RecReq) (*proto.RecResp, error)

func (GRPCServer) MakeComment

func (g GRPCServer) MakeComment(ctx context.Context, commentReq *proto.VideoComment) (*proto.Nothing, error)

func (GRPCServer) MakeCommentUpvote

func (g GRPCServer) MakeCommentUpvote(ctx context.Context, upvoteReq *proto.CommentUpvote) (*proto.Nothing, error)

func (GRPCServer) RateVideo

func (g GRPCServer) RateVideo(ctx context.Context, rating *proto.VideoRating) (*proto.Nothing, error)

func (GRPCServer) UploadMPDSet

func (g GRPCServer) UploadMPDSet(d *dashutils.DASHVideo) error

UploadMPDSet uploads the files to S3. Files may be overwritten (but they're versioned so they're safe). Need to ensure as a precondition that the video hasn't been uploaded before and the temp file ID hasn't been used.

func (GRPCServer) UploadVideo

func (g GRPCServer) UploadVideo(inpStream proto.VideoService_UploadVideoServer) error

func (GRPCServer) ViewVideo

func (g GRPCServer) ViewVideo(ctx context.Context, videoInp *proto.VideoViewing) (*proto.Nothing, error)

type VideoUpload

type VideoUpload struct {
	Meta         *proto.InputVideoChunk_Meta
	FileData     *os.File
	MetaFileData *os.File
}

Jump to

Keyboard shortcuts

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