Allow chaining of Register functions
This commit is contained in:
parent
756881cf14
commit
d54f088550
@ -46,10 +46,12 @@ func NewRouter(r *router.Router, logger log.Logger, endpointOverride ...Endpoint
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ro *Router) RegisterCallbackServer(srv server.CallbackServer) {
|
func (ro *Router) RegisterCallbackServer(srv server.CallbackServer) *Router {
|
||||||
ro.Register(ro.CallbackEndpoint, router.NewServer(srv.Callback).SetLogger(ro.Logger))
|
ro.Register(ro.CallbackEndpoint, router.NewServer(srv.Callback).SetLogger(ro.Logger))
|
||||||
|
return ro
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ro *Router) RegisterTokenServer(srv server.TokenServer) {
|
func (ro *Router) RegisterTokenServer(srv server.TokenServer) *Router {
|
||||||
ro.Register(ro.TokenEndpoint, router.NewServer(srv.Token).SetLogger(ro.Logger))
|
ro.Register(ro.TokenEndpoint, router.NewServer(srv.Token).SetLogger(ro.Logger))
|
||||||
|
return ro
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user