Documentation ¶
Index ¶
- type DB
- type KV
- type NodeItem
- type RootItem
- type Storage
- func (s *Storage) Get(ctx context.Context, key []byte) (*merkletree.Node, error)
- func (s *Storage) GetRoot(ctx context.Context) (*merkletree.Hash, error)
- func (s *Storage) Put(ctx context.Context, key []byte, node *merkletree.Node) error
- func (s *Storage) SetRoot(ctx context.Context, hash *merkletree.Hash) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NodeItem ¶
type NodeItem struct { MTId uint64 `db:"mt_id"` Key []byte `db:"key"` // Type is the type of node in the tree. Type byte `db:"type"` // ChildL is the left child of a middle node. ChildL []byte `db:"child_l"` // ChildR is the right child of a middle node. ChildR []byte `db:"child_r"` // Entry is the data stored in a leaf node. Entry []byte `db:"entry"` CreatedAt *uint64 `db:"created_at"` DeletedAt *uint64 `db:"deleted_at"` }
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage implements the db.Storage interface
func NewSqlStorage ¶
NewSqlStorage returns a new Storage
Click to show internal directories.
Click to hide internal directories.