You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
584 B

10 years ago
10 years ago
  1. package merkle
  2. type Tree interface {
  3. Size() (size int)
  4. Height() (height int8)
  5. Has(key interface{}) (has bool)
  6. Get(key interface{}) (index int, value interface{})
  7. GetByIndex(index int) (key interface{}, value interface{})
  8. Set(key interface{}, value interface{}) (updated bool)
  9. Remove(key interface{}) (value interface{}, removed bool)
  10. HashWithCount() (hash []byte, count int)
  11. Hash() (hash []byte)
  12. Save() (hash []byte)
  13. Load(hash []byte)
  14. Copy() Tree
  15. Iterate(func(key interface{}, value interface{}) (stop bool)) (stopped bool)
  16. }
  17. type Hashable interface {
  18. Hash() []byte
  19. }