runner

package module
v0.0.0-...-451182e Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 44 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HLSServer

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

func NewHLSServer

func NewHLSServer(liveDir string, log *slog.Logger, version string) *HLSServer

func (*HLSServer) ServeHTTP

func (h *HLSServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*HLSServer) Start

func (h *HLSServer) Start() error

type Runner

type Runner struct {
	StartTime time.Time
	protobuf.UnimplementedRunnerServiceServer

	Metrics *metrics.Broker
	Version string
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(v string) *Runner

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

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

func (r *Runner) Drain(ctx context.Context)

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

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

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 (r *Runner) RegisterWithGocast(retries int)

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 (*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) Run

func (r *Runner) Run(ctx context.Context)

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.

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.
ptr
tracing
Package tracing exports OpenTelemetry traces of the runner's jobs.
Package tracing exports OpenTelemetry traces of the runner's jobs.

Jump to

Keyboard shortcuts

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