MCPcopy
hub / github.com/wavetermdev/waveterm / validateServiceMethod

Function validateServiceMethod

pkg/service/service.go:402–415  ·  view source on GitHub ↗
(service string, method reflect.Method)

Source from the content-addressed store, hash-verified

400}
401
402func validateServiceMethod(service string, method reflect.Method) error {
403 for idx := 0; idx < method.Type.NumOut(); idx++ {
404 if err := validateMethodReturnArg(method.Type.Out(idx)); err != nil {
405 return fmt.Errorf("invalid return type %s.%s %s: %v", service, method.Name, method.Type.Out(idx), err)
406 }
407 }
408 for idx := 1; idx < method.Type.NumIn(); idx++ {
409 // skip the first argument which is the receiver
410 if err := validateMethodArg(method.Type.In(idx)); err != nil {
411 return fmt.Errorf("invalid argument type %s.%s %s: %v", service, method.Name, method.Type.In(idx), err)
412 }
413 }
414 return nil
415}
416
417func validateServiceMetaMethod(service string, method reflect.Method) error {
418 if method.Type.NumIn() != 1 {

Callers 1

ValidateServiceFunction · 0.85

Calls 2

validateMethodReturnArgFunction · 0.85
validateMethodArgFunction · 0.85

Tested by

no test coverage detected