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

Function findCmdMethod

pkg/wshutil/wshadapter.go:19–29  ·  view source on GitHub ↗
(impl any, cmd string)

Source from the content-addressed store, hash-verified

17var multiArgRType = reflect.TypeOf(wshrpc.MultiArg{})
18
19func findCmdMethod(impl any, cmd string) *reflect.Method {
20 rtype := reflect.TypeOf(impl)
21 methodName := cmd + "command"
22 for i := 0; i < rtype.NumMethod(); i++ {
23 method := rtype.Method(i)
24 if strings.ToLower(method.Name) == methodName {
25 return &method
26 }
27 }
28 return nil
29}
30
31func decodeRtnVals(rtnVals []reflect.Value) (any, error) {
32 switch len(rtnVals) {

Callers 1

serverImplAdapterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected