Service returns the service with the given name if any.
(name string)
| 52 | |
| 53 | // Service returns the service with the given name if any. |
| 54 | func (h *HTTPExpr) Service(name string) *HTTPServiceExpr { |
| 55 | for _, res := range h.Services { |
| 56 | if res.Name() == name { |
| 57 | return res |
| 58 | } |
| 59 | } |
| 60 | return nil |
| 61 | } |
| 62 | |
| 63 | // ServiceFor creates a new or returns the existing service definition for the |
| 64 | // given service. |