trackdataserver

package
v0.0.0-...-6e5775b Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const Bitrate int32 = 96000
View Source
const BytesPerRead int32 = Bitrate * 8 / int32(SecondsPerRead)
View Source
const SecondsBeforeAuthRequired = 10
View Source
const SecondsPerRead time.Duration = 5

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server implements the TrackDataService

func NewServer

func NewServer(db *pg.DB, sc Storage) *Server

NewServer creates an instance of our server

func (*Server) StreamTrackData

func (server *Server) StreamTrackData(ctx context.Context, userTrackPB *pb.UserTrack) (<-chan pb.TrackChunkOrError, error)

Request a track stream

func (*Server) UploadTrackData

func (server *Server) UploadTrackData(ctx context.Context, trackUpload *pb.TrackUpload) (*pb.TrackServerId, error)

Upload a track stream

type Storage

type Storage interface {
	GetTrackChunkFromStorage(string, *pb.TrackChunk) (*pb.TrackChunk, error)
	GetUploadUrl() (*storage.UploadUrl, error)
	UploadTrackToStorage(*pb.TrackUpload, *storage.UploadUrl) (*storage.StorageFileInfo, error)
}

Jump to

Keyboard shortcuts

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