Skip to content
This repository was archived by the owner on Feb 9, 2024. It is now read-only.

Dselans/protos v0.1.16 updated #63

Merged
merged 10 commits into from
Jan 24, 2024
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
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ import (

func main() {
sc, _ := streamdal.New(&streamdal.Config{
// Address of the streamdal server
ServerURL: "streamdal-server.svc.cluster.local:8082",

// Token used for authenticating with the streamdal server
ServerToken: "1234",

// Identify _this_ application/service (
ServiceName: "billing-svc",
ShutdownCtx: context.Background(),
})

resp := sc.Process(context.Background(), &streamdal.ProcessRequest{
Expand All @@ -43,13 +47,20 @@ func main() {
ComponentName: "kafka",
Data: []byte(`{"object": {"field": true}}`),
})

if resp.Error != nil {
fmt.Println(resp.ErrorMessage)
return
// Check if the .Process() call completed
if resp.Status != streamdal.StatusError {
fmt.Println("Successfully processed payload")
}

println(string(resp.Data))
// Or you can inspect each individual pipeline & step result
for _, pipeline := resp.PipelineStatus {
fmt.Printf("Inspecting '%d' steps in pipeline '%s'...\n", len(resp.PipelineStatus), pipeline.Name)

for _, step := range pipeline.StepStatus {
fmt.Printf("Step '%s' status: '%s'\n", step.Name, step.Status)
}
}
}

```
Expand Down
8 changes: 4 additions & 4 deletions benchmarks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ func benchmarkWASM(wasmFile, testPayloadFile string, step *protos.PipelineStep,
b.Fatal("unable to unmarshal wasm response: " + err.Error())
}

//WASMExitCode_WASM_EXIT_CODE_UNSET = 0
//WASMExitCode_WASM_EXIT_CODE_SUCCESS = 1
//WASMExitCode_WASM_EXIT_CODE_FAILURE = 2
//WASMExitCode_WASM_EXIT_CODE_INTERNAL_ERROR = 3
//WASMExitCode_WASM_EXIT_CODE_UNSET = 0
//WASMExitCode_WASM_EXIT_CODE_TRUE = 1
//WASMExitCode_WASM_EXIT_CODE_FALSE = 2
//WASMExitCode_WASM_EXIT_CODE_ERROR = 3
// Some benchmarks will intentionally fail, so allow status codes 1 and 2
if wasmResp.ExitCode < 1 || wasmResp.ExitCode > 2 {
b.Errorf("expected ExitCode = 0, got = %d, message: %s", wasmResp.ExitCode, wasmResp.ExitMsg)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/onsi/gomega v1.30.0
github.com/pkg/errors v0.9.1
github.com/relistan/go-director v0.0.0-20200406104025-dbbf5d95248d
github.com/streamdal/streamdal/libs/protos v0.1.14
github.com/streamdal/streamdal/libs/protos v0.1.16
github.com/tetratelabs/wazero v1.6.0
golang.org/x/time v0.5.0
google.golang.org/grpc v1.60.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIK
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/streamdal/streamdal/libs/protos v0.1.14 h1:DK1vPmBrX6fLy6uCmNJsonZdqp3zs3zXDCOaRwo3s6o=
github.com/streamdal/streamdal/libs/protos v0.1.14/go.mod h1:WZ6qCqzJu/9Vn+P5EUMN1hcOWlxN2EHgcsxehylhgJQ=
github.com/streamdal/streamdal/libs/protos v0.1.16 h1:e/xGg9rGBpr+wfNBAsRVPMGs8MlZLtmzfcjnYLdp2K0=
github.com/streamdal/streamdal/libs/protos v0.1.16/go.mod h1:WZ6qCqzJu/9Vn+P5EUMN1hcOWlxN2EHgcsxehylhgJQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
Expand Down
Loading