mirror of
https://github.com/navidrome/navidrome.git
synced 2026-05-03 06:51:16 +00:00
66 lines
1.8 KiB
Rust
66 lines
1.8 KiB
Rust
// Code generated by hostgen. DO NOT EDIT.
|
|
//
|
|
//! Navidrome Host Function Wrappers for Rust Plugins
|
|
//!
|
|
//! This crate provides idiomatic Rust wrappers for all Navidrome host services.
|
|
//! It is auto-generated by the hostgen tool and should not be edited manually.
|
|
//!
|
|
//! # Usage
|
|
//!
|
|
//! Add this crate as a dependency in your plugin's Cargo.toml:
|
|
//!
|
|
//! ```toml
|
|
//! [dependencies]
|
|
//! nd-host = { path = "../../host/rust" }
|
|
//! ```
|
|
//!
|
|
//! Then import the services you need:
|
|
//!
|
|
//! ```ignore
|
|
//! use nd_host::{cache, scheduler};
|
|
//!
|
|
//! fn my_plugin_function() -> Result<(), extism_pdk::Error> {
|
|
//! // Use the cache service
|
|
//! cache::set_string("my_key", "my_value", 3600)?;
|
|
//!
|
|
//! // Schedule a recurring task
|
|
//! scheduler::schedule_recurring("@every 5m", "payload", "task_id")?;
|
|
//!
|
|
//! Ok(())
|
|
//! }
|
|
//! ```
|
|
//!
|
|
//! # Available Services
|
|
//!
|
|
//! - [`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.
|
|
|
|
#[path = "nd_host_artwork.rs"]
|
|
pub mod artwork;
|
|
|
|
#[path = "nd_host_cache.rs"]
|
|
pub mod cache;
|
|
|
|
#[path = "nd_host_kvstore.rs"]
|
|
pub mod kvstore;
|
|
|
|
#[path = "nd_host_library.rs"]
|
|
pub mod library;
|
|
|
|
#[path = "nd_host_scheduler.rs"]
|
|
pub mod scheduler;
|
|
|
|
#[path = "nd_host_subsonicapi.rs"]
|
|
pub mod subsonicapi;
|
|
|
|
#[path = "nd_host_websocket.rs"]
|
|
pub mod websocket;
|
|
|
|
// Re-export commonly used types from extism-pdk for convenience
|
|
pub use extism_pdk::Error;
|