MCPcopy Create free account
hub / github.com/pydio/cells / Diff

Method Diff

common/registry/diff.go:29–44  ·  view source on GitHub ↗
(dt diff.DiffType, df diff.DiffFunc, cl *diff.Changelog, path []string, a, b reflect.Value, parent interface{})

Source from the content-addressed store, hash-verified

27}
28
29func (c *customValueDiffer) Diff(dt diff.DiffType, df diff.DiffFunc, cl *diff.Changelog, path []string, a, b reflect.Value, parent interface{}) error {
30 sa := a.Interface().(Item)
31 sb := b.Interface().(Item)
32
33 if err := c.DiffFunc(append(path, "id"), reflect.ValueOf(sa.ID()), reflect.ValueOf(sb.ID()), parent); err != nil {
34 return err
35 }
36 if err := c.DiffFunc(append(path, "name"), reflect.ValueOf(sa.Name()), reflect.ValueOf(sb.Name()), parent); err != nil {
37 return err
38 }
39 if err := c.DiffFunc(append(path, "metadata"), reflect.ValueOf(sa.Metadata()), reflect.ValueOf(sb.Metadata()), parent); err != nil {
40 return err
41 }
42
43 return nil
44}
45
46func (c *customValueDiffer) InsertParentDiffer(dfunc func(path []string, a, b reflect.Value, p interface{}) error) {
47 c.DiffFunc = dfunc

Callers

nothing calls this directly

Calls 4

InterfaceMethod · 0.65
IDMethod · 0.65
NameMethod · 0.65
MetadataMethod · 0.65

Tested by

no test coverage detected