MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / validateServiceMetaMethod

Function validateServiceMetaMethod

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

Source from the content-addressed store, hash-verified

415}
416
417func 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
427func ValidateService(serviceName string, svcObj any) error {
428 svcType := reflect.TypeOf(svcObj)

Callers 1

ValidateServiceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected