Skip to content

Commit 187fcc1

Browse files
committed
gen v2: Make generic JavaScript template work
1 parent 9bb8e23 commit 187fcc1

File tree

8 files changed

+11
-438
lines changed

8 files changed

+11
-438
lines changed

templates/client.js.tmpl renamed to client.js.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Client
55
//
66
{{ range .Services}}
7-
{{exportKeyword}}class {{.Name}} {
7+
{{jsExportKeyword}}class {{.Name}} {
88
constructor(hostname, fetch) {
99
this.path = '/rpc/{{.Name}}/'
1010
this.hostname = hostname
@@ -15,7 +15,7 @@
1515
return this.hostname + this.path + name
1616
}
1717
{{range .Methods}}
18-
{{.Name | methodName}} = ({{.Inputs | methodInputs}}) => {
18+
{{.Name | jsMethodName}} = ({{.Inputs | jsMethodInputs}}) => {
1919
return this.fetch(
2020
this.url('{{.Name}}'),
2121
{{- if .Inputs | len}}
@@ -28,7 +28,7 @@
2828
return {
2929
{{- $outputsCount := .Outputs|len -}}
3030
{{- range $i, $output := .Outputs}}
31-
{{$output | newOutputArgResponse}}{{listComma $i $outputsCount}}
31+
{{$output | jsNewOutputArgResponse}}{{listComma $i $outputsCount}}
3232
{{- end}}
3333
}
3434
})
File renamed without changes.

funcmap.go

Lines changed: 0 additions & 199 deletions
This file was deleted.

gen.go

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)