hashdb

package
v0.0.0-...-1bd1de5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2024 License: Apache-2.0, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDoesNotExists = stderr.New("node does not exists")
View Source
var ErrIncorrectHash = stderr.New("node hash is not correct")

Functions

This section is empty.

Types

type Node

type Node struct {
	Hash     merkletree.Hash
	Children []merkletree.Hash
}

func (Node) IsValid

func (n Node) IsValid() (bool, error)

func (Node) MarshalJSON

func (n Node) MarshalJSON() ([]byte, error)

func (*Node) UnmarshalJSON

func (n *Node) UnmarshalJSON(bytes []byte) error

type Storage

type Storage interface {
	SaveNodes(ctx context.Context, nodes []Node) error
	ByHash(ctx context.Context, hash merkletree.Hash) (Node, error)
}

func New

func New(db dbI) Storage

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL