| 415 | } |
| 416 | |
| 417 | func validateServiceMetaMethod(service string, method reflect.Method) error { |
| 418 | if method.Type.NumIn() != 1 { |
| 419 | return fmt.Errorf("invalid number of arguments %s.%s: got:%d, expected just the receiver", service, method.Name, method.Type.NumIn()) |
| 420 | } |
| 421 | if method.Type.NumOut() != 1 && method.Type.Out(0) != methodMetaRType { |
| 422 | return fmt.Errorf("invalid return type %s.%s: got:%s, expected servicemeta.MethodMeta", service, method.Name, method.Type.Out(0)) |
| 423 | } |
| 424 | return nil |
| 425 | } |
| 426 | |
| 427 | func ValidateService(serviceName string, svcObj any) error { |
| 428 | svcType := reflect.TypeOf(svcObj) |