extism / elixir-sdk

Extism Elixir Host SDK
BSD 3-Clause "New" or "Revised" License
27 stars 1 forks source link

Create some builder functions for manifest #9

Open bhelx opened 10 months ago

bhelx commented 10 months ago

It's a bit awkward to have to build the manifest map as a literal. We could perhaps have some small builder functions that help construct the manifest. Something like:

# instead of:
url = "https://github.com/extism/plugins/releases/latest/download/count_vowels.wasm"
manifest = %{wasm: [%{url: url}]}
# you have
manifest = Extism.Manifest.from_url(url)

This would be an addition to the API so doesn't need to go in by 1.0, but would be nice to have.