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

Method Scrub

dnode/scrub.go:15–26  ·  view source on GitHub ↗

Scrub creates an object that represents "callbacks" field in dnode message. The obj argument which will be scrubbed must be of array, slice, struct, or map type. If structure is passed, the returned callbacks map will contain its exported methods of func(*Partial) signature. Other functions must be

(obj interface{})

Source from the content-addressed store, hash-verified

13// exported methods of func(*Partial) signature. Other functions must be
14// wrapped by Callback function.
15func (s *Scrubber) Scrub(obj interface{}) (callbacks map[string]Path) {
16 callbacks = make(map[string]Path)
17 rv := reflect.ValueOf(obj)
18
19 k := rv.Kind()
20 if k != reflect.Array && k != reflect.Slice && k != reflect.Struct && k != reflect.Map {
21 return nil
22 }
23
24 s.collect(rv, make(Path, 0), callbacks)
25 return callbacks
26}
27
28var dnodeFunctionType = reflect.TypeOf(new(Function)).Elem()
29

Callers 3

TestScrubUnscrubFunction · 0.95
TestScrubFunction · 0.95
marshalAndSendMethod · 0.80

Calls 1

collectMethod · 0.95

Tested by 2

TestScrubUnscrubFunction · 0.76
TestScrubFunction · 0.76