| "veyron.io/veyron/veyron2/ipc" |
| type signatureInvoker struct { |
| // NewSignatureInvoker is the invoker factory. |
| func NewSignatureInvoker(suffix string) ipc.Invoker { |
| return ipc.ReflectInvoker(&signatureInvoker{suffix}) |
| // TODO(rthellend): This is a temporary hack until https://code.google.com/p/envyor/issues/detail?id=285 is resolved. |
| func (s signatureInvoker) Signature(ipc.ServerCall) (ipc.ServiceSignature, error) { |
| debugStub := ServerStubDebug{} |
| fullSig, _ := debugStub.Signature(nil) |
| if strings.HasPrefix(s.suffix, "logs") { |
| show = []string{"ReadLog", "Size", "Glob"} |
| } else if strings.HasPrefix(s.suffix, "pprof") { |
| show = []string{"Cmdline", "CPUProfile", "Profile", "Profiles", "Symbol"} |
| } else if strings.HasPrefix(s.suffix, "stats") { |
| show = []string{"Value", "Glob", "WatchGlob"} |
| sig := ipc.ServiceSignature{TypeDefs: fullSig.TypeDefs, Methods: make(map[string]ipc.MethodSignature)} |
| sig.Methods[m] = fullSig.Methods[m] |