github.com/rendobar/rendobar-go is the official Go client for Rendobar’s media processing and AI generation API: a params struct per job type, a context.Context on every call, retries that never create a second job, and responses already unwrapped from the { data } envelope. It needs Go 1.23 or later.
Overview and examples: Go SDK integration.
main.go
Jobs.Run submits the job and waits until it completes, fails or is cancelled. A failed or cancelled job returns *rendobar.JobFailedError with the job attached, so after a nil error job.Complete is set.
Client options
With no key,
Jobs.Types and Jobs.Schema still work. Every other call fails with CodeMissingAPIKey before it sends anything.
Jobs
Every method takes actx first.
CreateParams carries Params, Inputs, IdempotencyKey, Label, Destinations, Callback and ForceAsync. Params and Inputs are per job type.
Typed params
Each job type has its own params struct, generated from the API’s schema:FfmpegParams, FfprobeParams, CompressTargetParams, CaptionBurnParams, ImageUpscaleParams, and one per model for image generation and editing. The struct sets the job type, so a misspelt field or a wrong value type fails to compile.
rendobar.Ptr makes. Jobs.Create checks the params against the schema before it sends anything, and refuses them with an *rendobar.Error whose code is INVALID_ARGUMENT, one Problem per mistake.
An input is rendobar.URL(...), rendobar.URLs{...} for a list, rendobar.Content(...) for a small inline text file, rendobar.FromJob("job_...") for another job’s output, or rendobar.Fonts{...}. rendobar.CustomParams{Type, Fields} submits a job type newer than your SDK, and compose, whose nested timeline the SDK leaves untyped. The API checks it.
Wait
Wait polls until the job is complete, failed, or cancelled. Polling starts at 2 s and backs off to 10 s. Past the timeout it returns *rendobar.WaitTimeoutError with the job id, the last status and the last job read. The job may still finish.
With no Timeout, the wait allows 5 minutes. Once the job reports its own time limit from your plan, the wait extends to that limit plus 2 minutes, so a long job is never reported as timed out while it runs. Wait returns a failed or cancelled job with a nil error. Only Run turns those into *JobFailedError.
When your ctx ends during a wait, Run and Wait return *rendobar.ContextError. The job keeps running, and its JobID lets you call Jobs.Get, Jobs.Wait or Jobs.Cancel later.
Read the output
Arendobar.Job has one field set per status: Waiting, Dispatched, Running, Complete, Failed or Cancelled. Check the status before reading the output:
Output.File is the headline file (the single file, or the HLS or DASH manifest) and is nil for data-only jobs. The output shape is the same for every job type. JobComplete.Ffprobe() reads an ffprobe job’s result as the typed FfprobeResult. A status newer than your SDK leaves all six fields nil, and job.ID(), job.Status() and job.IsTerminal() still answer.
Jobs.Download streams a job’s output file. Close the body when you are done. WithTimeout bounds only the wait for the response headers, so a large file takes as long as your ctx allows.
Uploads and assets
Uploads.Create sends a local file and returns the ready *rendobar.Asset. It takes an io.ReaderAt and the size, so an *os.File works. A large file goes up in parts, five at a time by default, and each part is retried up to 3 times:
Inputs key is the filename staged in the working directory, and the command refers to it by that bare name. An upload expires after 24 hours unless UploadParams.Persist is set. Assets.List, Assets.Get, Assets.Delete and Assets.Download manage what the workspace holds.
To deliver outputs to a connected bucket, set Destinations: []string{"storage://<id>/<folder>"} on CreateParams.
Errors
Check an error witherrors.As and compare its Code with the rendobar.Code... constants:
Error.Problems lists what a refusal found wrong, each with a Path, a Message and, for a plan limit, the UpgradeTo plan. Calls that fail before anything is sent have StatusCode 0: CodeMissingAPIKey, CodeInvalidAPIKey and CodeInvalidArgument. The codes are in the error catalogue.
Retries and idempotency
A 429 is retried twice on every call. A 500, 502, 503 or 504 and a connection error are retried twice on a read and on a job submit, which carries its idempotency key. A create, update or delete that fails that way returns the error at once, because the API may have acted on it. Retries back off from half a second and honour aRetry-After of up to 60 seconds. rendobar.WithMaxRetries(0) sends each request once.
A retried submit never creates a second job. Each Jobs.Create call sends one idempotency key on every retry. Pass IdempotencyKey yourself, or one from rendobar.GenerateIdempotencyKey, to make separate calls safe to repeat. A repeat with the same params returns the first job with Created.Replayed set. The same key with different params returns a 409 with code CONFLICT.
When a submit fails in a way that may have created the job (your ctx ending, a connection error, a 429 or 5xx after the last retry), Jobs.Create returns *rendobar.SubmitError. Submit again with its key to get that job:
Webhooks
Webhooks.Create registers an endpoint and returns its SigningSecret, in full only there and in RotateSecret. Test, ListDeliveries and RetryDelivery operate it.
Import github.com/rendobar/rendobar-go/webhooks to verify and read every delivery:
Parse checks the HMAC over {timestamp}.{body}, refuses deliveries more than 5 minutes old (ErrTimestamp), a signature that does not match (ErrSignature) and an empty secret (ErrNoSecret), and accepts the previous secret during a rotation. event.ID is the delivery id, the same on every retry of one delivery. webhooks.Verify is the signature check alone, as a bool. Event payloads are in the webhooks guide.
Realtime
Importgithub.com/rendobar/rendobar-go/realtime to stream events over a WebSocket. It is its own package, so programs that do not import it do not build in its WebSocket library. Client.Job follows one job and returns after its final status:
Client.Events streams every event in the org until your ctx ends. Both reconnect with backoff and resume after the last event they yielded, so you never see one twice. The key travels in the Authorization header, never in the URL.
Pagination
Jobs.List returns one page, up to 100 jobs. Jobs.All fetches every page for you as you range over it:
Examples
The examples folder has small programs that use the SDK end to end: a quickstart, an upload trimmed and streamed back to disk, a batch worker with idempotency keys and every error type, anet/http webhook receiver that manages its own endpoint, and an account admin. CI runs every one.
Versioning
The module follows semantic versioning. While it is at 0.x, a minor release may tighten types, and the changelog says so. Deprecations are announced before anything is removed. CI tests Go 1.23 and the two newest Go releases. See versioning and deprecations and the changelog.See also
- Job types: the type, inputs, and params for every job
- How a job works: statuses and the output shape
- Webhooks: event payloads and delivery retries
- Error codes: every code a request or job returns