Conversation
| run: go mod tidy | ||
| - name: Build | ||
| run: go build -v ./... | ||
| run: go build -tags=cli -v ./... |
There was a problem hiding this comment.
Is this done only for ones with tag cli, are there any other tags
There was a problem hiding this comment.
yes there is wasm tag also currently build is failing , checking that now
| keyValuePair := fmt.Sprintf("%s=%s", key, val.Data().(string)) | ||
| command = append(command, keyValuePair) |
controller/controller.wasm.go
Outdated
| // TODO - replace stuff in headers, and varjson and json as well | ||
| cmd, stdinBody := cmdgen.ConstructCommand(block) | ||
| resp, e1 := cmdexec.ExecCommand(cmd, stdinBody) | ||
| printFields(resp) |
There was a problem hiding this comment.
Added it for debugging purpose, printing the response
l2.wasm.go
Outdated
| js.Global().Set("lama2Wasm", js.FuncOf(lama2Wasm)) | ||
| js.Global().Set("goWebRequestFunc", wasmLamaPromise()) | ||
| select {} |
There was a problem hiding this comment.
Can add a comment on what these lines do
l2.wasm.go
Outdated
|
|
||
| func lama2Wasm(this js.Value, i []js.Value) interface{} { | ||
| go func() { | ||
| controller.ProcessWasmInput("GET\nhttps://httpbin.org/get") |
There was a problem hiding this comment.
Is this for processing the Default request?
There was a problem hiding this comment.
That function was for testing purpose , removed
| "github.com/HexmosTech/lama2/l2lsp/request" | ||
| "github.com/HexmosTech/lama2/l2lsp/response" | ||
| "github.com/rs/zerolog/log" | ||
| // "github.com/rs/zerolog/log" |
There was a problem hiding this comment.
this is for logging purpose
preprocess/preprocess.wasm.go
Outdated
|
|
||
| func ExpandHeaders(block *gabs.Container) { | ||
| headerMap := block.S("details", "headers") | ||
| // log.Info().Str("HeaderMap", headerMap.String()).Msg("") |
preprocess/preprocess.wasm.go
Outdated
| @@ -0,0 +1,220 @@ | |||
| //go:build wasm | |||
There was a problem hiding this comment.
What is the basic difference in the code between preprocess.wasm.go and preprocess.go
There was a problem hiding this comment.
there is a lot of code repetition there converted it into 3 separate file to remove duplication
There was a problem hiding this comment.
The difference is in function calls , wasm has 1 parameter , cli has 2 params , each of them calls different functions
What type of MR is this? (check all applicable)
Web assembly integration for Lama2.
Modifying Golang to add support for building web assembly binary.
Important files to start review from in the order
controller.cli.go
Controller.wasm.go
controller.go
other major changes :