Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix req/res type casing #98

Merged
merged 2 commits into from
May 16, 2017
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
18 changes: 9 additions & 9 deletions codegen/template_bundle/template_files.go

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

6 changes: 3 additions & 3 deletions codegen/templates/tchannel_client.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ type {{$clientName}} struct {
args *{{.RequestType}},
{{end -}}
) ({{- if ne .ResponseType "" -}} *{{.ResponseType}}, {{- end -}}map[string]string, error) {
var result {{.GenCodePkgName}}.{{$svc.Name}}_{{.Name}}_Result
var result {{.GenCodePkgName}}.{{title $svc.Name}}_{{title .Name}}_Result

{{if eq .RequestType "" -}}
args := &{{.GenCodePkgName}}.{{$svc.Name}}_{{.Name}}_Args{}
args := &{{.GenCodePkgName}}.{{title $svc.Name}}_{{title .Name}}_Args{}
{{end -}}
success, respHeaders, err := c.client.Call(
ctx, c.thriftService, "{{.Name}}", reqHeaders, args, &result,
Expand All @@ -98,7 +98,7 @@ type {{$clientName}} struct {
{{if eq .ResponseType "" -}}
return respHeaders, err
{{else -}}
resp, err := {{.GenCodePkgName}}.{{$svc.Name}}_{{.Name}}_Helper.UnwrapResponse(&result)
resp, err := {{.GenCodePkgName}}.{{title $svc.Name}}_{{title .Name}}_Helper.UnwrapResponse(&result)
return resp, respHeaders, err
{{end -}}
}
Expand Down
4 changes: 2 additions & 2 deletions codegen/templates/tchannel_client_test_server.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ func (h *{{$handler}}) Handle(
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req {{$genCodePkg}}.{{$svc.Name}}_{{.Name}}_Args
var res {{$genCodePkg}}.{{$svc.Name}}_{{.Name}}_Result
var req {{$genCodePkg}}.{{title $svc.Name}}_{{title .Name}}_Args
var res {{$genCodePkg}}.{{title $svc.Name}}_{{title .Name}}_Result

if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
Expand Down
2 changes: 1 addition & 1 deletion codegen/templates/tchannel_endpoint.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (h *{{$handlerName}}) Handle(
}
{{- end}}

var res {{$genCodePkg}}.{{.ThriftService}}_{{.Name}}_Result
var res {{$genCodePkg}}.{{title .ThriftService}}_{{title .Name}}_Result

{{if ne .RequestType "" -}}
var req {{.RequestType}}
Expand Down
14 changes: 6 additions & 8 deletions glide.lock

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

8 changes: 3 additions & 5 deletions glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import:
- package: github.com/go-yaml/yaml
version: a83829b6f1293c91addabc89d0571c246397bbf4
- package: github.com/mailru/easyjson
version: c7e8f2b687054e448f35ff2693bd298c1a2f3a10
repo: https://github.com/Raynos/easyjson.git
vcs: git
version: dffba8d13bbd998df17d8557570cdea0624b9d1d
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My PR is merged. 😀

subpackages:
- buffer
- jlexer
Expand Down Expand Up @@ -44,6 +42,6 @@ import:
- package: github.com/buger/jsonparser
version: 5b691c8ebc4af5191baa426561d62f1b5115d6e5
-testImport:
- package: github.com/stretchr/testify
- subpackages:
- package: github.com/stretchr/testify
- subpackages:
- - assert