Documentation
¶
Index ¶
- type HLSServer
- type Runner
- func (r *Runner) Cleanup()
- func (r *Runner) CutVOD(ctx context.Context, req *protobuf.CutVODRequest) (*protobuf.CutVODResponse, error)
- func (r *Runner) Drain(ctx context.Context)
- func (r *Runner) GenerateLivePreview(ctx context.Context, req *protobuf.LivePreviewRequest) (*protobuf.LivePreviewResponse, error)
- func (r *Runner) InitApiGrpc()
- func (r *Runner) PrepareUpload(ctx context.Context, req *protobuf.PrepareUploadRequest) (*protobuf.PrepareUploadResponse, error)
- func (r *Runner) RegenerateThumbnail(ctx context.Context, req *protobuf.RegenerateThumbnailRequest) (*protobuf.RegenerateThumbnailResponse, error)
- func (r *Runner) RegisterWithGocast(retries int)
- func (r *Runner) RequestSectionImages(ctx context.Context, req *protobuf.SectionImageRequest) (*protobuf.SectionImageResponse, error)
- func (r *Runner) RequestStream(ctx context.Context, req *protobuf.StreamRequest) (*protobuf.StreamResponse, error)
- func (r *Runner) RequestStreamEnd(_ context.Context, req *protobuf.StreamEndRequest) (*protobuf.StreamEndResponse, error)
- func (r *Runner) RequestWaveform(ctx context.Context, req *protobuf.WaveformRequest) (*protobuf.WaveformResponse, error)
- func (r *Runner) Run(ctx context.Context)
- func (r *Runner) RunAction(a, vod []actions.Action, data map[string]any, logger *slog.Logger) string
- func (r *Runner) RunActionContext(parent context.Context, a, vod []actions.Action, data map[string]any, ...) string
- func (r *Runner) WaitIdle()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runner ¶
type Runner struct {
StartTime time.Time
protobuf.UnimplementedRunnerServiceServer
Metrics *metrics.Broker
Version string
// contains filtered or unexported fields
}
func (*Runner) Cleanup ¶
func (r *Runner) Cleanup()
Cleanup is called on force shutdown while actions are still running. it cancels all running actions
func (*Runner) CutVOD ¶
func (r *Runner) CutVOD(ctx context.Context, req *protobuf.CutVODRequest) (*protobuf.CutVODResponse, error)
CutVOD cuts parts out of one version of a recorded stream. Progress and the result are delivered asynchronously, like those of an upload, so this only acknowledges the job.
func (*Runner) Drain ¶
Drain tells the manager to stop assigning jobs. ctx must outlive the signal that started the shutdown: the notification is handed to handleNotifications, which has to still be running to take it.
func (*Runner) GenerateLivePreview ¶
func (r *Runner) GenerateLivePreview(ctx context.Context, req *protobuf.LivePreviewRequest) (*protobuf.LivePreviewResponse, error)
GenerateLivePreview grabs a frame from the end of a running livestream. It is deliberately not a job: nothing is tracked or notified, the caller waits for the JPEG.
func (*Runner) InitApiGrpc ¶
func (r *Runner) InitApiGrpc()
func (*Runner) PrepareUpload ¶
func (r *Runner) PrepareUpload(ctx context.Context, req *protobuf.PrepareUploadRequest) (*protobuf.PrepareUploadResponse, error)
PrepareUpload reserves a slot for a video file upload. The file is then POSTed to the upload endpoint with the returned token; the result is delivered asynchronously in VODReady and ThumbnailReady notifications, so nothing is started here.
func (*Runner) RegenerateThumbnail ¶
func (r *Runner) RegenerateThumbnail(ctx context.Context, req *protobuf.RegenerateThumbnailRequest) (*protobuf.RegenerateThumbnailResponse, error)
RegenerateThumbnail regenerates the thumbnail for an already-recorded VOD. The result is delivered asynchronously in a ThumbnailReadyNotification, so this only acknowledges the job.
func (*Runner) RegisterWithGocast ¶
func (*Runner) RequestSectionImages ¶
func (r *Runner) RequestSectionImages(ctx context.Context, req *protobuf.SectionImageRequest) (*protobuf.SectionImageResponse, error)
RequestSectionImages generates a thumbnail for each of the given video sections of an already recorded stream. The images are delivered asynchronously in a SectionImagesReadyNotification, so this only acknowledges the job.
func (*Runner) RequestStream ¶
func (r *Runner) RequestStream(ctx context.Context, req *protobuf.StreamRequest) (*protobuf.StreamResponse, error)
func (*Runner) RequestStreamEnd ¶
func (r *Runner) RequestStreamEnd(_ context.Context, req *protobuf.StreamEndRequest) (*protobuf.StreamEndResponse, error)
func (*Runner) RequestWaveform ¶
func (r *Runner) RequestWaveform(ctx context.Context, req *protobuf.WaveformRequest) (*protobuf.WaveformResponse, error)
RequestWaveform builds the audio level timeline for the cut editor. The result is delivered asynchronously in a WaveformReadyNotification, so this only acknowledges the job.
func (*Runner) RunAction ¶
func (r *Runner) RunAction(a, vod []actions.Action, data map[string]any, logger *slog.Logger) string
RunAction is RunActionContext for a job that is not part of a trace.
func (*Runner) RunActionContext ¶
func (r *Runner) RunActionContext(parent context.Context, a, vod []actions.Action, data map[string]any, logger *slog.Logger) string
RunActionContext runs the actions in a in the background and returns the id of the created job. The actions in a keep running after the job's context was cancelled, which is what lets StreamEnd report the end of a stream that was stopped early. The VoD actions are skipped entirely when the stream was ended with discardVod.
The VoD actions run under a context of their own. Turning the segments captured until the cancellation into a VoD is precisely what still has to happen after a stream was ended early, so they must not inherit the cancelled stream context: every exec.CommandContext in them would fail before it started.
parent only supplies the trace the job belongs to, see tracing.Detach.
func (*Runner) WaitIdle ¶
func (r *Runner) WaitIdle()
WaitIdle returns once no job, upload or critical notification is pending. Jobs and uploads are waited for as long as they take; notifications for at most notifyGrace after they are the only thing left, see defaultNotifyGrace.
A job hands its last notification to handleNotifications before it ends, and the handler only takes the hold for it after receiving, so a zero count alone could be read in between. Sending a heartbeat through the same channel closes that gap: the handler takes it only once it has finished with everything it received before, and the count is checked again after.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
runner
command
|
|
|
pkg
|
|
|
metrics
Package metrics provides Prometheus compatible monitoring.
|
Package metrics provides Prometheus compatible monitoring. |
|
mtls
Package mtls builds the gRPC credentials for the link between gocast and the runners.
|
Package mtls builds the gRPC credentials for the link between gocast and the runners. |
|
tracing
Package tracing exports OpenTelemetry traces of the runner's jobs.
|
Package tracing exports OpenTelemetry traces of the runner's jobs. |