ServiceFor creates a new or returns the existing service definition for the given service.
(s *ServiceExpr)
| 23 | // ServiceFor creates a new or returns the existing service definition for |
| 24 | // the given service. |
| 25 | func (g *GRPCExpr) ServiceFor(s *ServiceExpr) *GRPCServiceExpr { |
| 26 | if res := g.Service(s.Name); res != nil { |
| 27 | return res |
| 28 | } |
| 29 | res := &GRPCServiceExpr{ |
| 30 | ServiceExpr: s, |
| 31 | } |
| 32 | g.Services = append(g.Services, res) |
| 33 | return res |
| 34 | } |
| 35 | |
| 36 | // EvalName returns the name printed in case of evaluation error. |
| 37 | func (*GRPCExpr) EvalName() string { |