mirror of
https://github.com/navidrome/navidrome.git
synced 2026-05-03 06:51:16 +00:00
55 lines
1.6 KiB
Go
55 lines
1.6 KiB
Go
// Code generated by ndpgen. DO NOT EDIT.
|
|
|
|
/*
|
|
Package host provides Navidrome Plugin Development Kit wrappers for Go/TinyGo plugins.
|
|
|
|
This package is auto-generated by the ndpgen tool and should not be edited manually.
|
|
|
|
# Usage
|
|
|
|
Add this module as a dependency in your plugin's go.mod:
|
|
|
|
require github.com/navidrome/navidrome/plugins/pdk/go/host v0.0.0
|
|
|
|
Then import the package in your plugin code:
|
|
|
|
import host "github.com/navidrome/navidrome/plugins/pdk/go/host"
|
|
|
|
func myPluginFunction() error {
|
|
// Use the cache service
|
|
_, err := host.CacheSetString("my_key", "my_value", 3600)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
// Schedule a recurring task
|
|
_, err = host.SchedulerScheduleRecurring("@every 5m", "payload", "task_id")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
# Available Services
|
|
|
|
The following host services are available:
|
|
|
|
- Artwork: provides artwork URL generation capabilities for plugins.
|
|
- Cache: provides in-memory TTL-based caching capabilities for plugins.
|
|
- KVStore: provides persistent key-value storage for plugins.
|
|
- Library: provides access to music library metadata for plugins.
|
|
- Scheduler: provides task scheduling capabilities for plugins.
|
|
- SubsonicAPI: provides access to Navidrome's Subsonic API from plugins.
|
|
- WebSocket: provides WebSocket communication capabilities for plugins.
|
|
|
|
# Building Plugins
|
|
|
|
Go plugins must be compiled to WebAssembly using TinyGo:
|
|
|
|
tinygo build -o plugin.wasm -target=wasip1 -buildmode=c-shared .
|
|
|
|
See the examples directory for complete plugin implementations.
|
|
*/
|
|
package host
|