Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions examples/cdn/cache/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/cdn/cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ crate-type = ["cdylib"]

[dependencies]
proxy-wasm = "0.2"
fastedge = { path = "../../..", features = ["proxywasm"] }
fastedge = { version = "0.4", features = ["proxywasm"] }
querystring = "1.1"
serde_json = "1"
14 changes: 7 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@
//! // Get a secret value
//! match secret::get("API_KEY")? {
//! Some(api_key) => {
//! // Use the API key
//! let key = String::from_utf8_lossy(&api_key);
//! // Use the API key (a String)
//! let _key: String = api_key;
//! Response::builder()
//! .status(StatusCode::OK)
//! .body(Body::from("Secret retrieved"))
Expand Down Expand Up @@ -222,7 +222,7 @@
//! let content = b"<h1>Hello</h1>".to_vec();
//!
//! // Store it for 60 seconds
//! cache::set(key, content.clone(), Some(60_000))?;
//! cache::set(key, &content, Some(60_000))?;
//!
//! Response::builder()
//! .status(StatusCode::OK)
Expand Down Expand Up @@ -306,8 +306,8 @@ pub mod dictionary {
/// // Get current secret value
/// match secret::get("DATABASE_PASSWORD")? {
/// Some(password) => {
/// let pwd = String::from_utf8_lossy(&password);
/// // Use the password to connect to database
/// // `password` is a String; use it to connect to the database
/// let _pwd: String = password;
/// }
/// None => {
/// eprintln!("Secret not found");
Expand Down Expand Up @@ -446,10 +446,10 @@ pub mod key_value {
/// use fastedge::cache;
///
/// // Store with a 5-minute TTL
/// cache::set("session:abc123", b"user-data".to_vec(), Some(300_000))?;
/// cache::set("session:abc123", b"user-data", Some(300_000))?;
///
/// // Store with no expiry
/// cache::set("config:flags", b"enabled".to_vec(), None)?;
/// cache::set("config:flags", b"enabled", None)?;
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// ```
///
Expand Down
2 changes: 1 addition & 1 deletion wit
Submodule wit updated 1 files
+1 −1 cache-sync.wit
Loading