Skip to content

Commit

Permalink
tweak names
Browse files Browse the repository at this point in the history
  • Loading branch information
colonelpanic8 committed Jun 2, 2016
1 parent 3348bec commit 6421b34
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions thrift/interfaces.go
Expand Up @@ -45,9 +45,9 @@ type TChanServer interface {
Methods() []string
}

// InterceptorRunnerRegistrar is a target for the registration of an
// interceptorRunnerRegistrar is a target for the registration of an
// interceptor runner.
type InterceptorRunnerRegistrar interface {
type interceptorRunnerRegistrar interface {
// RegisterInterceptorRunner registers the interceptor runner.
RegisterInterceptorRunner(InterceptorRunner)
}
Expand Down
2 changes: 1 addition & 1 deletion thrift/server.go
Expand Up @@ -81,7 +81,7 @@ func (s *Server) Register(svr TChanServer, opts ...RegisterOption) {
for _, m := range svr.Methods() {
s.ch.Register(s, service+"::"+m)
}
if registrar, ok := svr.(InterceptorRunnerRegistrar); ok {
if registrar, ok := svr.(interceptorRunnerRegistrar); ok {
registrar.RegisterInterceptorRunner(s)
}
}
Expand Down
6 changes: 3 additions & 3 deletions thrift/thrift-gen/tchannel-template.go
Expand Up @@ -149,7 +149,7 @@ func (s *{{ .ServerStruct }}) Handle(ctx {{ contextType }}, methodName string, p
}
{{ range .Methods }}
func (s *{{ $svc.ServerStruct }}) {{ .HandleFunc }}(ctx {{ contextType }}, protocol athrift.TProtocol) (handled bool, resp athrift.TStruct, retErr error) {
func (s *{{ $svc.ServerStruct }}) {{ .HandleFunc }}(ctx {{ contextType }}, protocol athrift.TProtocol) (success bool, resp athrift.TStruct, retErr error) {
var req {{ .ArgsType }}
var res {{ .ResultType }}
const serviceMethod = "{{ $svc.ThriftName }}::{{ .ThriftName }}"
Expand All @@ -163,15 +163,15 @@ func (s *{{ .ServerStruct }}) Handle(ctx {{ contextType }}, methodName string, p
defer func () {
resp = &res
retErr = postRun(resp, err)
handled = retErr == nil
success = retErr == nil
if retErr != nil {
resp = nil
{{ if .HasExceptions }}
switch v := retErr.(type) {
{{ range .Exceptions }}
case {{ .ArgType }}:
if v == nil {
retErr = fmt.Errorf("Handler for {{ .Name }} returned non-nil error type {{ .ArgType }} but nil value")
retErr = fmt.Errorf("handler for {{ .Name }} returned non-nil error type {{ .ArgType }} but nil value")
} else {
res.{{ .ArgStructName }} = v
retErr = nil
Expand Down

0 comments on commit 6421b34

Please sign in to comment.