Skip to content

Commit

Permalink
Merge branch 'master' into VojtechVitek-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
VojtechVitek committed Nov 6, 2024
2 parents 135c0bb + 27970f3 commit 158e3f4
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 67 deletions.
73 changes: 40 additions & 33 deletions _examples/golang-basics/example.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 25 additions & 18 deletions _examples/golang-imports/api.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 19 additions & 16 deletions types.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,26 @@

{{- end }}

var (
methods = map[string]method{
{{- range $_, $service := $services -}}
{{- range $_, $method := $service.Methods }}
"/rpc/{{$service.Name}}/{{$method.Name}}": {
Name: "{{$method.Name}}",
Service: "{{$service.Name}}",
Annotations: map[string]string{
{{- range $_, $annotation := $method.Annotations -}}
"{{$annotation.AnnotationType}}": "{{$annotation.Value}}",
{{- end -}}
},
},
{{- end -}}
{{ end }}
var methods = map[string]method{
{{- range $_, $service := $services -}}
{{- range $_, $method := $service.Methods }}
"/rpc/{{$service.Name}}/{{$method.Name}}": {
Name: "{{$method.Name}}",
Service: "{{$service.Name}}",
Annotations: map[string]string{ {{- range $_, $annotation := $method.Annotations -}}"{{$annotation.AnnotationType}}": "{{$annotation.Value}}", {{- end -}} },
},
{{- end -}}
{{ end }}
}

func WebrpcMethods() map[string]method {
res := make(map[string]method, len(methods))
for k, v := range methods {
res[k] = v
}
)

return res
}

var WebRPCServices = map[string][]string{
{{- range $_, $service := $services}}
Expand Down

0 comments on commit 158e3f4

Please sign in to comment.