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

Method Unscrub

dnode/unscrub.go:10–29  ·  view source on GitHub ↗
(arguments interface{}, callbacks map[string]Path, f func(uint64) functionReceived)

Source from the content-addressed store, hash-verified

8)
9
10func (s *Scrubber) Unscrub(arguments interface{}, callbacks map[string]Path, f func(uint64) functionReceived) error {
11 v := reflect.ValueOf(arguments)
12 if v.Kind() != reflect.Ptr {
13 panic("arguments must be a pointer")
14 }
15
16 // Parse callbacks field and create callback functions.
17 for sid, path := range callbacks {
18 id, err := strconv.ParseUint(sid, 10, 64)
19 if err != nil {
20 return err
21 }
22
23 if err = setCallback(v, path, f(id)); err != nil {
24 return err
25 }
26 }
27
28 return nil
29}
30
31func setCallback(value reflect.Value, path Path, cb functionReceived) error {
32 i := 0

Callers 1

TestScrubUnscrubFunction · 0.95

Calls 1

setCallbackFunction · 0.85

Tested by 1

TestScrubUnscrubFunction · 0.76