Parent returns the parent service if any, nil otherwise.
()
| 148 | |
| 149 | // Parent returns the parent service if any, nil otherwise. |
| 150 | func (svc *HTTPServiceExpr) Parent() *HTTPServiceExpr { |
| 151 | if svc.ParentName != "" { |
| 152 | if parent := svc.Root.Service(svc.ParentName); parent != nil { |
| 153 | return parent |
| 154 | } |
| 155 | } |
| 156 | return nil |
| 157 | } |
| 158 | |
| 159 | // HTTPError returns the service HTTP error with given name if any. |
| 160 | func (svc *HTTPServiceExpr) HTTPError(name string) *HTTPErrorExpr { |