Skip to content

Commit

Permalink
Merge pull request #10 from extism/add-simple-greet-plugin
Browse files Browse the repository at this point in the history
Add simple greet plugin
  • Loading branch information
bhelx authored Feb 3, 2024
2 parents 92cdb35 + a4ce60b commit be1e735
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ members = [
"store_credit",
"loop_forever",
"count_vowels_kvstore",
"http"
"http",
"greet"
]
resolver = "2"

Expand Down
12 changes: 12 additions & 0 deletions greet/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "greet"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
crate_type = ["cdylib"]

[dependencies]
extism-pdk.workspace = true
6 changes: 6 additions & 0 deletions greet/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use extism_pdk::*;

#[plugin_fn]
pub fn greet(name: String) -> FnResult<String> {
Ok(format!("Hello, {}!", name))
}

0 comments on commit be1e735

Please sign in to comment.