Expose a way to update the router
@@ -28,6 +28,11 @@ func NewRegister(router router.Router, params Params) *Register {
return &Register{router, params}
}
+// UpdateRouter updates the reference to the router. This is useful to reload the mutex
+func (p *Register) UpdateRouter(router router.Router) {
+ p.Router = router
+}
+
// AddMany registers many proxies at once
func (p *Register) AddMany(routes []*Route) error {
for _, r := range routes {
