Version: 1.0 (WebEncode v2025) SDK Package:
github.com/rennerdo30/webencode/pkg/pluginsdk
WebEncode uses a Hyper-Modular 5-Pillar Plugin Mesh architecture. This means nearly all functionality (except the Core Kernel) is offloaded to plugins.
Plugins are standalone binaries that the Kernel starts and communicates with over gRPC (via HashiCorp's go-plugin system).
- Auth: Identity, Session Validation, RBAC (e.g., LDAP, OIDC).
- Storage: File I/O for VOD/Live assets (e.g., S3, Local FS).
- Encoder: Transcoding logic (e.g., FFmpeg, Hardware).
- Live: RTMP/WebRTC ingest and telemetry (e.g., MediaMTX).
- Publisher: Distribution to external platforms (e.g., YouTube, Twitch).
To create a new plugin, create a Go main package.
package main
import (
"github.com/hashicorp/go-plugin"
"github.com/rennerdo30/webencode/pkg/pluginsdk"
)
func main() {
// 1. Define your implementation
impl := &MyStoragePlugin{}
// 2. Serve the plugin
plugin.Serve(&plugin.ServeConfig{
HandshakeConfig: pluginsdk.HandshakeConfig,
Plugins: map[string]plugin.Plugin{
"storage": &pluginsdk.Plugin{
StorageImpl: impl, // Register the interface you implement
},
},
GRPCServer: plugin.DefaultGRPCServer,
})
}
// Ensure you implement the specific interface
type MyStoragePlugin struct {
pluginsdk.UnimplementedStorageServiceServer // Embed for forward compatibility
}Build your plugin as a standalone binary:
go build -o ./bin/my-plugin ./cmd/my-pluginRegister your plugin in the WebEncode Kernel by pointing to the binary path in plugins.toml or via the API.
Used for verifying tokens and managing users.
| Method | Request | Response | Description |
|---|---|---|---|
ValidateToken |
TokenRequest |
UserSession |
Validates a Bearer/API token. |
Authorize |
AuthZRequest |
AuthZResponse |
Checks RBAC permissions. |
GetUser |
UserRequest |
User |
Fetches user profile. |
Used for reading/writing media files.
| Method | Description |
|---|---|
Upload / Download |
Streaming RPCs for file transfer. |
GetURL / GetUploadURL |
Generate signed URLs (if supported). |
BrowseRoots / Browse |
File browser capabilities. |
Used for probing and transcoding media.
| Method | Description |
|---|---|
Probe |
Returns metadata (width, height, bitrate) for a file. |
Transcode |
Streaming RPC returns progress updates (0-100%). |
GetCapabilities |
Reports supported codecs (h264, hevc, etc.). |
Used for managing RTMP/WebRTC sessions.
| Method | Description |
|---|---|
StartIngest |
Provisions a stream key/URL. |
StopIngest |
Terminates a session. |
GetTelemetry |
Polled by Kernel for stats (Viewers, Bitrate). |
Used for uploading final assets to external sites.
| Method | Description |
|---|---|
Publish |
Uploads file/stream to YouTube/Twitch. |
Retract |
Deletes/Unlists the content. |
The SDK includes a HealthCheck automatically. You do not need to implement Check or Watch.
You can import github.com/rennerdo30/webencode/pkg/pluginsdk in your tests to mock the gRPC server interactions.
- Build your plugin binary.
- Run the Kernel with your plugin registered.
- Check Kernel logs for
[PLUGIN] <name> started. - Use the WebEncode UI/API to trigger actions handled by your plugin.
- Stdout/Stderr: Plugins communicate via stdout. DO NOT use
fmt.Printlnin your plugin code. It will corrupt the handshake. Usehclogor thepkg/loggerprovided by the SDK which writes to stderr. - Duplicate Registration: Do not register
grpc_health_v1manually;go-plugindoes this for you. - CGO: Ensure your plugin is built with the same architecture (Linux/AMD64) if running inside Docker.