Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiffAdtArray ¶
func DiffAdtArray(preArr, curArr Array, out AdtArrayDiff) error
DiffAdtArray accepts two *adt.Array's and an AdtArrayDiff implementation. It does the following: - All values that exist in preArr and not in curArr are passed to AdtArrayDiff.Remove() - All values that exist in curArr nnd not in prevArr are passed to adtArrayDiff.Add() - All values that exist in preArr and in curArr are passed to AdtArrayDiff.Modify()
- It is the responsibility of AdtArrayDiff.Modify() to determine if the values it was passed have been modified.
func DiffAdtMap ¶
func DiffAdtMap(preMap, curMap Map, out AdtMapDiff) error
Types ¶
type AdtArrayDiff ¶
type AdtArrayDiff interface { Add(key uint64, val *typegen.Deferred) error Modify(key uint64, from, to *typegen.Deferred) error Remove(key uint64, val *typegen.Deferred) error }
AdtArrayDiff generalizes adt.Array diffing by accepting a Deferred type that can unmarshalled to its corresponding struct in an interface implantation. Add should be called when a new k,v is added to the array Modify should be called when a value is modified in the array Remove should be called when a value is removed from the array
type AdtMapDiff ¶
type AdtMapDiff interface { AsKey(key string) (abi.Keyer, error) Add(key string, val *typegen.Deferred) error Modify(key string, from, to *typegen.Deferred) error Remove(key string, val *typegen.Deferred) error }
AdtMapDiff generalizes adt.Map diffing by accepting a Deferred type that can unmarshalled to its corresponding struct in an interface implantation. AsKey should return the Keyer implementation specific to the map Add should be called when a new k,v is added to the map Modify should be called when a value is modified in the map Remove should be called when a value is removed from the map