Change endpoints variable to endpoint
This commit is contained in:
parent
7a8eaeab05
commit
b0f51d88c7
12
router.go
12
router.go
@ -23,18 +23,18 @@ type Router struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewRouter(r *router.Router, logger log.Logger, endpointOverride ...Endpoint) (ro *Router) {
|
func NewRouter(r *router.Router, logger log.Logger, endpointOverride ...Endpoint) (ro *Router) {
|
||||||
var endpoints Endpoint
|
var endpoint Endpoint
|
||||||
if r == nil {
|
if r == nil {
|
||||||
r = router.NewRouter(nil, nil)
|
r = router.NewRouter(nil, nil)
|
||||||
}
|
}
|
||||||
if len(endpointOverride) == 1 {
|
if len(endpointOverride) == 1 {
|
||||||
endpoints = endpointOverride[0]
|
endpoint = endpointOverride[0]
|
||||||
} else {
|
} else {
|
||||||
endpoints = endpointDefault
|
endpoint = endpointDefault
|
||||||
}
|
}
|
||||||
r.AddRequiredRoutes([]string{
|
r.AddRequiredRoutes([]string{
|
||||||
endpoints.CallbackEndpoint,
|
endpoint.CallbackEndpoint,
|
||||||
endpoints.TokenEndpoint,
|
endpoint.TokenEndpoint,
|
||||||
})
|
})
|
||||||
if logger == nil {
|
if logger == nil {
|
||||||
logger = log.NewPlainLogger()
|
logger = log.NewPlainLogger()
|
||||||
@ -42,7 +42,7 @@ func NewRouter(r *router.Router, logger log.Logger, endpointOverride ...Endpoint
|
|||||||
return &Router{
|
return &Router{
|
||||||
Router: r,
|
Router: r,
|
||||||
Logger: logger,
|
Logger: logger,
|
||||||
Endpoint: endpoints,
|
Endpoint: endpoint,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user