OnName is a hook to execute user functions on each route naming. Also you can get route properties by route parameter. WARN: OnName only works with naming routes, not groups.
(handler ...OnNameHandler)
| 249 | // |
| 250 | // WARN: OnName only works with naming routes, not groups. |
| 251 | func (h *Hooks) OnName(handler ...OnNameHandler) { |
| 252 | h.app.mutex.Lock() |
| 253 | h.onName = append(h.onName, handler...) |
| 254 | h.app.mutex.Unlock() |
| 255 | } |
| 256 | |
| 257 | // OnGroup is a hook to execute user functions on each group registration. |
| 258 | // Also you can get group properties by group parameter. |