Skip to content

Commit

Permalink
shorter names
Browse files Browse the repository at this point in the history
  • Loading branch information
bombela committed Nov 22, 2016
1 parent 523431d commit 6a82fbe
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ type Outbounds map[string]transport.Outbounds

// Filters contains the different type of filters
type Filters struct {
UnaryFilter transport.UnaryFilter
OnewayFilter transport.OnewayFilter
Unary transport.UnaryFilter
Oneway transport.OnewayFilter
}

// Interceptors contains the different type of interceptors
type Interceptors struct {
UnaryInterceptor transport.UnaryInterceptor
OnewayInterceptor transport.OnewayInterceptor
Unary transport.UnaryInterceptor
Oneway transport.OnewayInterceptor
}

// NewDispatcher builds a new Dispatcher using the specified Config.
Expand Down Expand Up @@ -120,12 +120,12 @@ func convertOutbounds(outbounds Outbounds, filters Filters) Outbounds {

// apply filters and create ValidatorOutbounds
if outs.Unary != nil {
unaryOutbound = transport.ApplyUnaryFilter(outs.Unary, filters.UnaryFilter)
unaryOutbound = transport.ApplyUnaryFilter(outs.Unary, filters.Unary)
unaryOutbound = request.UnaryValidatorOutbound{UnaryOutbound: unaryOutbound}
}

if outs.Oneway != nil {
onewayOutbound = transport.ApplyOnewayFilter(outs.Oneway, filters.OnewayFilter)
onewayOutbound = transport.ApplyOnewayFilter(outs.Oneway, filters.Oneway)
onewayOutbound = request.OnewayValidatorOutbound{OnewayOutbound: outs.Oneway}
}

Expand Down Expand Up @@ -248,11 +248,11 @@ func (d dispatcher) Register(rs []transport.Registrant) {
switch r.HandlerSpec.Type() {
case transport.Unary:
h := transport.ApplyUnaryInterceptor(r.HandlerSpec.Unary(),
d.Interceptors.UnaryInterceptor)
d.Interceptors.Unary)
r.HandlerSpec = transport.NewUnaryHandlerSpec(h)
case transport.Oneway:
h := transport.ApplyOnewayInterceptor(r.HandlerSpec.Oneway(),
d.Interceptors.OnewayInterceptor)
d.Interceptors.Oneway)
r.HandlerSpec = transport.NewOnewayHandlerSpec(h)
default:
panic(fmt.Sprintf("unknown handler type %q for service %q, procedure %q",
Expand Down
2 changes: 1 addition & 1 deletion examples/json/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func main() {
},
},
Filters: yarpc.Filters{
UnaryFilter: yarpc.UnaryFilters(requestLogFilter{}),
Unary: yarpc.UnaryFilters(requestLogFilter{}),
},
})
if err := dispatcher.Start(); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion examples/json/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func main() {
http.NewInbound(":24034"),
},
Interceptors: yarpc.Interceptors{
UnaryInterceptor: requestLogInterceptor{},
Unary: requestLogInterceptor{},
},
})

Expand Down
2 changes: 1 addition & 1 deletion examples/thrift/keyvalue/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func main() {
},
},
Filters: yarpc.Filters{
UnaryFilter: cache,
Unary: cache,
},
})
if err := dispatcher.Start(); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions yarpctest/recorder/recorder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func withDisconnectedClient(t *testing.T, recorder *Recorder, f func(raw.Client)
},
},
Filters: yarpc.Filters{
UnaryFilter: recorder,
Unary: recorder,
},
})
require.NoError(t, clientDisp.Start())
Expand Down Expand Up @@ -202,7 +202,7 @@ func withConnectedClient(t *testing.T, recorder *Recorder, f func(raw.Client)) {
},
},
Filters: yarpc.Filters{
UnaryFilter: recorder,
Unary: recorder,
},
})
require.NoError(t, clientDisp.Start())
Expand Down

0 comments on commit 6a82fbe

Please sign in to comment.