MCPcopy Index your code
hub / github.com/koding/kite / methods

Method methods

dnode/scrub.go:106–119  ·  view source on GitHub ↗

methods walks over a structure and scrubs its exported methods.

(rv reflect.Value, path Path, callbacks map[string]Path)

Source from the content-addressed store, hash-verified

104
105// methods walks over a structure and scrubs its exported methods.
106func (s *Scrubber) methods(rv reflect.Value, path Path, callbacks map[string]Path) {
107 for i := 0; i < rv.NumMethod(); i++ {
108 if rv.Type().Method(i).PkgPath == "" { // exported
109 cb, ok := rv.Method(i).Interface().(func(*Partial))
110 if !ok {
111 continue
112 }
113
114 name := rv.Type().Method(i).Name
115 name = strings.ToLower(name[0:1]) + name[1:]
116 s.register(cb, append(path, name), callbacks)
117 }
118 }
119}
120
121// register is called when a function/method is found in arguments array. It
122// assigns an unique ID to the passed callback and stores it internally.

Callers 1

collectMethod · 0.95

Calls 1

registerMethod · 0.95

Tested by

no test coverage detected