UserType returns the user type expression with the given name if found, nil otherwise.
(name string)
| 136 | |
| 137 | // UserType returns the user type expression with the given name if found, nil otherwise. |
| 138 | func (r *RootExpr) UserType(name string) UserType { |
| 139 | for _, t := range r.Types { |
| 140 | if t.Name() == name { |
| 141 | return t |
| 142 | } |
| 143 | } |
| 144 | for _, t := range r.ResultTypes { |
| 145 | if t.Name() == name { |
| 146 | return t |
| 147 | } |
| 148 | } |
| 149 | return nil |
| 150 | } |
| 151 | |
| 152 | // Service returns the service with the given name. |
| 153 | func (r *RootExpr) Service(name string) *ServiceExpr { |