Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WaitForRecordingState ¶
func WaitForRecordingState( ctx context.Context, c recpb.RecordingsClient, recording string, wantStates ...recpb.Recording_State, ) (r *recpb.Recording, err error)
WaitForRecordingState blocks until the state returned from a GetRecording invocation for the named recording is in wantStates.
Types ¶
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker takes responsibility for getting recording data off the local machine. It subscribes to recording events from BBB, advising a remote RPC service about a recording state until they can be uploaded to off-machine stable storage.
func NewTracker ¶
func NewTracker(rpcClient recpb.RecordingsClient, opts ...TrackerOption) *Tracker
NewTracker returns a Tracker configured to use rpcClient to talk to the recordings service and with the provided TrackerOptions applied, if any.
func (*Tracker) TrackRecordings ¶
TrackRecordings subscribes to the appropriate channel on BBB's Redis PubSub, pushing recording state to the configured recordings service until asked to stop (by canceling ctx). Note that TrackRecordings does its work synchronously, so you probably want to start it in a new goroutine.
type TrackerOption ¶
type TrackerOption func(t *Tracker)
A TrackerOption can be passed to NewTracker to customize a Tracker's behaviour.
func WithBaseDir ¶
func WithBaseDir(path string) TrackerOption
WithBaseDir configures the base directory where BBB stores "published" recordings (default /var/bigbluebutton/published/presentation).
func WithLogger ¶
func WithLogger(l *zap.Logger) TrackerOption
WithLogger makes the Tracker write logs to the provided Logger.
func WithOrigin ¶
func WithOrigin(name string) TrackerOption
WithOrigin configures the Tracker to use name as the origin for recordings coming from the local machine (default is whatever os.Hostname returns).
func WithReadyForUploadChan ¶
func WithReadyForUploadChan(c chan<- *recpb.Recording) TrackerOption
WithReadyForUploadChan configures the tracker to notify about recordings that completed BBB processing and are ready for uploading elsewhere.
func WithRedisOptions ¶
func WithRedisOptions(opts *redis.Options) TrackerOption
WithRedisOptions configures a Tracker to use the provided redis.Options. Use this option to talk to a Redis DB different from the default DB 0 on localhost:6379.
type UploadOption ¶
type UploadOption func(*Uploader)
An UploadOption customized the behaviour of an Uploader.
func WithUploadLogger ¶
func WithUploadLogger(l *zap.Logger) UploadOption
WithUploadLogger returns an option configuring the Uploader to write logs to l.
type Uploader ¶
type Uploader struct {
// contains filtered or unexported fields
}
An Uploader is responsible for uploading a single recording to the configured remote service.
func Upload ¶
func Upload( ctx context.Context, rpc recpb.UploadsClient, rec *recpb.Recording, fromDir string, opts ...UploadOption, ) (u *Uploader, err error)
Upload returns an Uploader configured for the specified recording and remote service.
Notes ¶
Bugs ¶
Unexpected error, drop on the floor for now. Need to think about how and when to retry.