fix: module path
This commit is contained in:
parent
90b13eb5ee
commit
967a695a35
12 changed files with 25 additions and 35 deletions
|
@ -4,7 +4,7 @@ This module provides glue code to implement a buildr WASI module easily and quic
|
||||||
To implement a new buildr WASI module:
|
To implement a new buildr WASI module:
|
||||||
|
|
||||||
1. Create a new Go module
|
1. Create a new Go module
|
||||||
1. Reference this SDK (`go get -u code.icb4dc0.de/buildr/wasi-module-sdk`)
|
1. Reference this SDK (`go get -u code.icb4dc0.de/buildr/wasi-module-sdk-go`)
|
||||||
1. create a `main.go` with an **empty** `main()` function
|
1. create a `main.go` with an **empty** `main()` function
|
||||||
1. implement the `sdk.Module` interface for your module
|
1. implement the `sdk.Module` interface for your module
|
||||||
1. implement an `init()` function that registers your module and the SDK's type registry
|
1. implement an `init()` function that registers your module and the SDK's type registry
|
||||||
|
|
|
@ -2,7 +2,7 @@ version: v1
|
||||||
managed:
|
managed:
|
||||||
enabled: true
|
enabled: true
|
||||||
go_package_prefix:
|
go_package_prefix:
|
||||||
default: code.icb4dc0.de/buildr/wasi-module-sdk/internal
|
default: code.icb4dc0.de/buildr/wasi-module-sdk-go/internal
|
||||||
except:
|
except:
|
||||||
- buf.build/googleapis/googleapis
|
- buf.build/googleapis/googleapis
|
||||||
plugins:
|
plugins:
|
||||||
|
|
|
@ -6,8 +6,8 @@ import (
|
||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
_ "github.com/tetratelabs/tinymem"
|
_ "github.com/tetratelabs/tinymem"
|
||||||
|
|
||||||
"code.icb4dc0.de/buildr/wasi-module-sdk/mem"
|
"code.icb4dc0.de/buildr/wasi-module-sdk-go/mem"
|
||||||
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk/protocol/generated/rpc/v1"
|
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
var defaultRegistry = NewTypeRegistry()
|
var defaultRegistry = NewTypeRegistry()
|
||||||
|
|
|
@ -3,17 +3,10 @@ module hello_world
|
||||||
go 1.20
|
go 1.20
|
||||||
|
|
||||||
require (
|
require (
|
||||||
code.icb4dc0.de/buildr/wasi-module-sdk-go v0.0.0-00010101000000-000000000000
|
|
||||||
code.icb4dc0.de/buildr/wasi-module-sdk/integration v0.0.0-00010101000000-000000000000
|
|
||||||
github.com/mailru/easyjson v0.7.7
|
github.com/mailru/easyjson v0.7.7
|
||||||
golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53
|
golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53
|
||||||
)
|
)
|
||||||
|
|
||||||
replace (
|
|
||||||
code.icb4dc0.de/buildr/wasi-module-sdk => ../../
|
|
||||||
code.icb4dc0.de/buildr/wasi-module-sdk/integration => ../../integration
|
|
||||||
)
|
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/google/uuid v1.3.0 // indirect
|
github.com/google/uuid v1.3.0 // indirect
|
||||||
github.com/josharian/intern v1.0.0 // indirect
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
|
|
|
@ -3,7 +3,7 @@ package main
|
||||||
//go:generate tinygo build -o hello_world.wasm -scheduler=none -gc=leaking --no-debug -target=wasi main.go
|
//go:generate tinygo build -o hello_world.wasm -scheduler=none -gc=leaking --no-debug -target=wasi main.go
|
||||||
|
|
||||||
import (
|
import (
|
||||||
sdk "code.icb4dc0.de/buildr/wasi-module-sdk"
|
sdk "code.icb4dc0.de/buildr/wasi-module-sdk-go"
|
||||||
"hello_world/module"
|
"hello_world/module"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package main_test
|
package main_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
sdk "code.icb4dc0.de/buildr/wasi-module-sdk"
|
sdk "code.icb4dc0.de/buildr/wasi-module-sdk-go"
|
||||||
"code.icb4dc0.de/buildr/wasi-module-sdk/integration"
|
"code.icb4dc0.de/buildr/wasi-module-sdk-go/integration"
|
||||||
"context"
|
"context"
|
||||||
_ "embed"
|
_ "embed"
|
||||||
"golang.org/x/exp/slog"
|
"golang.org/x/exp/slog"
|
||||||
|
|
|
@ -3,7 +3,7 @@ package module
|
||||||
//go:generate go run -mod=mod github.com/mailru/easyjson/easyjson -all hello_world.go
|
//go:generate go run -mod=mod github.com/mailru/easyjson/easyjson -all hello_world.go
|
||||||
|
|
||||||
import (
|
import (
|
||||||
sdk "code.icb4dc0.de/buildr/wasi-module-sdk"
|
sdk "code.icb4dc0.de/buildr/wasi-module-sdk-go"
|
||||||
"golang.org/x/exp/slog"
|
"golang.org/x/exp/slog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ module code.icb4dc0.de/buildr/wasi-module-sdk-go/integration
|
||||||
go 1.20
|
go 1.20
|
||||||
|
|
||||||
require (
|
require (
|
||||||
code.icb4dc0.de/buildr/wasi-module-sdk-go v0.0.0-00010101000000-000000000000
|
|
||||||
github.com/google/uuid v1.3.0
|
github.com/google/uuid v1.3.0
|
||||||
github.com/tetratelabs/wazero v1.1.0
|
github.com/tetratelabs/wazero v1.1.0
|
||||||
golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53
|
golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53
|
||||||
|
@ -15,5 +14,3 @@ require (
|
||||||
github.com/tetratelabs/tinymem v0.1.0 // indirect
|
github.com/tetratelabs/tinymem v0.1.0 // indirect
|
||||||
google.golang.org/protobuf v1.30.0 // indirect
|
google.golang.org/protobuf v1.30.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
replace code.icb4dc0.de/buildr/wasi-module-sdk => ../
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"code.icb4dc0.de/buildr/wasi-module-sdk/mem"
|
"code.icb4dc0.de/buildr/wasi-module-sdk-go/mem"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/tetratelabs/wazero"
|
"github.com/tetratelabs/wazero"
|
||||||
|
@ -16,8 +16,8 @@ import (
|
||||||
"github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1"
|
"github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1"
|
||||||
"golang.org/x/exp/slog"
|
"golang.org/x/exp/slog"
|
||||||
|
|
||||||
sdk "code.icb4dc0.de/buildr/wasi-module-sdk"
|
sdk "code.icb4dc0.de/buildr/wasi-module-sdk-go"
|
||||||
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk/protocol/generated/rpc/v1"
|
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
func StateKey(cat sdk.Category, modName, key string) string {
|
func StateKey(cat sdk.Category, modName, key string) string {
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
|
|
||||||
"golang.org/x/exp/slog"
|
"golang.org/x/exp/slog"
|
||||||
|
|
||||||
"code.icb4dc0.de/buildr/wasi-module-sdk/mem"
|
"code.icb4dc0.de/buildr/wasi-module-sdk-go/mem"
|
||||||
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk/protocol/generated/rpc/v1"
|
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ slog.Handler = (*WASIHandler)(nil)
|
var _ slog.Handler = (*WASIHandler)(nil)
|
||||||
|
|
|
@ -865,19 +865,19 @@ var file_rpc_v1_executor_proto_rawDesc = []byte{
|
||||||
0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e,
|
0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e,
|
||||||
0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d,
|
0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d,
|
||||||
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x07,
|
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x07,
|
||||||
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x42, 0xb6, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e,
|
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x42, 0xb9, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e,
|
||||||
0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x45,
|
0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x45,
|
||||||
0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c,
|
0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f,
|
||||||
0x63, 0x6f, 0x64, 0x65, 0x2e, 0x69, 0x63, 0x62, 0x34, 0x64, 0x63, 0x30, 0x2e, 0x64, 0x65, 0x2f,
|
0x63, 0x6f, 0x64, 0x65, 0x2e, 0x69, 0x63, 0x62, 0x34, 0x64, 0x63, 0x30, 0x2e, 0x64, 0x65, 0x2f,
|
||||||
0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2f, 0x77, 0x61, 0x73, 0x69, 0x2d, 0x6d, 0x6f, 0x64, 0x75,
|
0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2f, 0x77, 0x61, 0x73, 0x69, 0x2d, 0x6d, 0x6f, 0x64, 0x75,
|
||||||
0x6c, 0x65, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f,
|
0x6c, 0x65, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e,
|
||||||
0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x72, 0x70, 0x63, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x42,
|
0x61, 0x6c, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x72, 0x70, 0x63, 0x76, 0x31, 0xa2,
|
||||||
0x52, 0x58, 0xaa, 0x02, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x52, 0x70, 0x63, 0x2e,
|
0x02, 0x03, 0x42, 0x52, 0x58, 0xaa, 0x02, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x52,
|
||||||
0x56, 0x31, 0xca, 0x02, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x5c, 0x52, 0x70, 0x63, 0x5c,
|
0x70, 0x63, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x5c, 0x52,
|
||||||
0x56, 0x31, 0xe2, 0x02, 0x19, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x5c, 0x52, 0x70, 0x63, 0x5c,
|
0x70, 0x63, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x5c, 0x52,
|
||||||
0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02,
|
0x70, 0x63, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
|
||||||
0x0f, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x3a, 0x3a, 0x52, 0x70, 0x63, 0x3a, 0x3a, 0x56, 0x31,
|
0x61, 0xea, 0x02, 0x0f, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x3a, 0x3a, 0x52, 0x70, 0x63, 0x3a,
|
||||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -3,8 +3,8 @@ package sdk
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"code.icb4dc0.de/buildr/wasi-module-sdk/mem"
|
"code.icb4dc0.de/buildr/wasi-module-sdk-go/mem"
|
||||||
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk/protocol/generated/rpc/v1"
|
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StateProxy struct {
|
type StateProxy struct {
|
||||||
|
|
Loading…
Reference in a new issue