Service returns the service with the given name if any.
(name string)
| 12 | |
| 13 | // Service returns the service with the given name if any. |
| 14 | func (g *GRPCExpr) Service(name string) *GRPCServiceExpr { |
| 15 | for _, res := range g.Services { |
| 16 | if res.Name() == name { |
| 17 | return res |
| 18 | } |
| 19 | } |
| 20 | return nil |
| 21 | } |
| 22 | |
| 23 | // ServiceFor creates a new or returns the existing service definition for |
| 24 | // the given service. |