(svc *Service, md *descriptorpb.MethodDescriptorProto)
| 227 | } |
| 228 | |
| 229 | func defaultAPIOptions(svc *Service, md *descriptorpb.MethodDescriptorProto) (*options.HttpRule, error) { |
| 230 | // FQSN prefixes the service's full name with a '.', e.g.: '.example.ExampleService' |
| 231 | fqsn := strings.TrimPrefix(svc.FQSN(), ".") |
| 232 | |
| 233 | // This generates an HttpRule that matches the gRPC mapping to HTTP/2 described in |
| 234 | // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests |
| 235 | // i.e.: |
| 236 | // * method is POST |
| 237 | // * path is "/<service name>/<method name>" |
| 238 | // * body should contain the serialized request message |
| 239 | rule := &options.HttpRule{ |
| 240 | Pattern: &options.HttpRule_Post{ |
| 241 | Post: fmt.Sprintf("/%s/%s", fqsn, md.GetName()), |
| 242 | }, |
| 243 | Body: "*", |
| 244 | } |
| 245 | return rule, nil |
| 246 | } |
| 247 | |
| 248 | func (r *Registry) newParam(meth *Method, path string) (Parameter, error) { |
| 249 | msg := meth.RequestType |
no test coverage detected