File: types.go

package info (click to toggle)
tendermint-go-merkle 0.0~git20160312.0.05042c6-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 124 kB
  • ctags: 107
  • sloc: makefile: 8
file content (21 lines) | stat: -rw-r--r-- 542 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package merkle

type Tree interface {
	Size() (size int)
	Height() (height int8)
	Has(key []byte) (has bool)
	Get(key []byte) (index int, value []byte, exists bool)
	GetByIndex(index int) (key []byte, value []byte)
	Set(key []byte, value []byte) (updated bool)
	Remove(key []byte) (value []byte, removed bool)
	HashWithCount() (hash []byte, count int)
	Hash() (hash []byte)
	Save() (hash []byte)
	Load(hash []byte)
	Copy() Tree
	Iterate(func(key []byte, value []byte) (stop bool)) (stopped bool)
}

type Hashable interface {
	Hash() []byte
}