Skip to content

Commit

Permalink
intermediate commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sreedeep-rougeloop committed May 25, 2024
1 parent 8eadb84 commit a48a9cf
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
4 changes: 4 additions & 0 deletions cmdgen/cmdgen.wasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ func assembleCmdString(httpv string, url string, jsonObj *gabs.Container, header
return cleanCommand, jsonStr
}

// func assembleCmdString(httpv string, url string, jsonObj *gabs.Container, headers *gabs.Container, multipart bool, form bool, o *lama2cmd.Opts) ([]string, string) {
// return assembleCmdStringHelper(httpv, url, jsonObj, headers, multipart, form, o.Nocolor)
// }

func ConstructCommand(parsedInput *gabs.Container) ([]string, string) {
httpv := parsedInput.S("verb", "value")
url := parsedInput.S("url", "value")
Expand Down
13 changes: 13 additions & 0 deletions codegen/codegen.cli.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//go:wasm cli

package codegen

import (
_ "embed"

"github.com/HexmosTech/lama2/cmdexec"
)

func initialize() {
globalVM = cmdexec.GetJSVm()
}
2 changes: 0 additions & 2 deletions codegen/codegen.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:wasm cli

package codegen

import (
Expand Down
13 changes: 0 additions & 13 deletions codegen/codegen.wasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,6 @@ type SnippetArgs struct {
SnippetCore string
}

func PrepareHTTPSnippetGenerator(snippetArgs SnippetArgs) string {
var templOutput bytes.Buffer
templStr := `{{.SnippetCore}}
const snippet = new window.HTTPSnippet({{.HARRequest}});
let convertedSnippet = snippet.convert('{{.Language}}'{{if .Library }}, '{{.Library}}'{{end}});
`
tmpl, _ := template.New("httpsnippet").Parse(templStr)
tmpl.Execute(&templOutput, snippetArgs)
return templOutput.String()
}

// takes in the headers in L2 format, and generates
// HAR compatible
func GetHARHeadersCookies(headers *gabs.Container) (*gabs.Container, *gabs.Container) {
Expand Down
1 change: 1 addition & 0 deletions todo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cmdgen 3 folders dependancy from controller

0 comments on commit a48a9cf

Please sign in to comment.