.go files you copy directly into your project — no module dependency, no CGo. It communicates with the dpf binary over stdin/stdout.
Copy the binary
Build or download the dpf binary and place it somewhere your application can reach at runtime.Verify it works:
Copy the Go client files
Create a package directory inside your project and copy the four source files:
After copying, change the
package declaration at the top of each file to match your internal package path. For example, if you placed the files under internal/dpf/, the declaration should read package dpf. The package name does not have to match the directory path, but keeping them consistent avoids confusion.Client API
Creating a client
NewClient sets a default timeout of 30 seconds. Adjust it with SetTimeout before executing any jobs:
Executing a job
Execute accepts any of the typed job structs and returns a *JobResult:
Convenience methods
The client exposes shorthand methods for the most common operations:Error handling
Check the returnederror first (network/process failures), then check result.Success for operation-level failures:
JobResult structure
Every successful call returns a*JobResult:
| Field | Type | Description |
|---|---|---|
Success | bool | Whether the operation succeeded |
Operation | string | Name of the executed operation |
Outputs | []OutputFile | Produced files |
ElapsedMs | uint64 | Processing time in milliseconds |
Metadata | *json.RawMessage | Operation-specific metadata (e.g. video stats) |
OutputFile contains Path, Format, Width, Height, SizeBytes, and optionally DataBase64 when Inline: true was set on the job.