| 212 | } |
| 213 | |
| 214 | func extractAPIOptions(meth *descriptorpb.MethodDescriptorProto) (*options.HttpRule, error) { |
| 215 | if meth.Options == nil { |
| 216 | return nil, nil |
| 217 | } |
| 218 | if !proto.HasExtension(meth.Options, options.E_Http) { |
| 219 | return nil, nil |
| 220 | } |
| 221 | ext := proto.GetExtension(meth.Options, options.E_Http) |
| 222 | opts, ok := ext.(*options.HttpRule) |
| 223 | if !ok { |
| 224 | return nil, fmt.Errorf("extension is %T; want an HttpRule", ext) |
| 225 | } |
| 226 | return opts, nil |
| 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' |