Skip to content

Commit

Permalink
feat(example): add keyvalue-inmemory provider
Browse files Browse the repository at this point in the history
Signed-off-by: Brooks Townsend <brooksmtownsend@gmail.com>

real example

Signed-off-by: Brooks Townsend <brooksmtownsend@gmail.com>
  • Loading branch information
brooksmtownsend committed May 22, 2024
1 parent 9cbf0bf commit ab66063
Show file tree
Hide file tree
Showing 26 changed files with 1,942 additions and 89 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
> [!WARNING]
> Experimental!
## Golang SDK for Providers
## Golang SDK for Providers

This is a experimenal SDK for writing wasmCloud providers in Go.

An example can be found in the examples repo, under providers/inmemkv
An example can be found in [cmd/keyvalue-inmemory](./cmd/keyvalue-inmemory/) which implements `wasi:keyvalue@0.2.0-draft`.

A demo can be found at
A demo can be found at
`ghcr.io/jordan-rash/kv-provider:v0.0.3`
7 changes: 0 additions & 7 deletions cmd/blank/build.sh

This file was deleted.

56 changes: 0 additions & 56 deletions cmd/blank/main.go

This file was deleted.

4 changes: 0 additions & 4 deletions cmd/blank/run.sh

This file was deleted.

2 changes: 2 additions & 0 deletions examples/keyvalue-inmemory/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
keyvalue-inmemory
keyvalue-inmemory.par.gz
8 changes: 8 additions & 0 deletions examples/keyvalue-inmemory/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Keyvalue inmemory golang provider

This provider implements `wasi:keyvalue/store@0.2.0-draft`.

## Notable files

- [main.go](./main.go) is a simple binary that sets up an errGroup to handle running the provider's primary requirements: executing as a standaline binary based on data received on stdin, handling RPC and connecting to a wasmCloud lattice.
- [keyvalue.go](./keyvalue.go) implements the required functions to conform to `wasi:keyvalue/store`. If the functions as specified in the [WIT](./wit/deps/keyvalue/store.wit) are not implemented, this provider will fail to build.
Loading

0 comments on commit ab66063

Please sign in to comment.