Versions in this module Expand all Collapse all v0 v0.4.5 Jun 27, 2022 Changes in this version + const Directory + const File + const MaxLevel + const PathSeparator + var ErrEmptyPath = errors.New("empty path") + var ErrInvalidInput = errors.New("input invalid") + var ErrInvalidVersionHash = errors.New("invalid version hash") + var ErrMetadataTooLarge = errors.New("metadata too large") + var ErrNoLoader = errors.New("Node is reference but no loader") + var ErrNoSaver = errors.New("Node is not persisted but no saver") + var ErrNotFound = errors.New("not found") + var ErrTooShort = errors.New("serialised input too short") + var ZeroObfuscationKey []byte + func SetObfuscationKeyFn(fn func([]byte) (int, error)) + type LoadSaver interface + type Loader interface + Load func(ctx context.Context, reference []byte, index int64) (data []byte, err error) + type Node struct + func New() *Node + func NewNodeRef(ref []byte) *Node + func (n *Node) Add(ctx context.Context, path, entry []byte, metadata map[string]string, ...) error + func (n *Node) Entry() []byte + func (n *Node) HasPrefix(ctx context.Context, path []byte, l Loader) (bool, error) + func (n *Node) Index() int64 + func (n *Node) IsEdgeType() bool + func (n *Node) IsValueType() bool + func (n *Node) IsWithMetadataType() bool + func (n *Node) IsWithPathSeparatorType() bool + func (n *Node) Lookup(ctx context.Context, path []byte, l Loader) ([]byte, error) + func (n *Node) LookupNode(ctx context.Context, path []byte, l Loader) (*Node, error) + func (n *Node) MarshalBinary() (bytes []byte, err error) + func (n *Node) Metadata() map[string]string + func (n *Node) Prefix() [][]byte + func (n *Node) Reference() []byte + func (n *Node) Remove(ctx context.Context, path []byte, ls LoadSaver) error + func (n *Node) Save(ctx context.Context, s Saver) error + func (n *Node) SetObfuscationKey(obfuscationKey []byte) + func (n *Node) String() string + func (n *Node) UnmarshalBinary(data []byte) error + func (n *Node) Walk(ctx context.Context, root []byte, l Loader, walkFn WalkFunc) error + func (n *Node) WalkLevel(ctx context.Context, root []byte, l Loader, level uint, walker WalkLevelFunc) error + func (n *Node) WalkNode(ctx context.Context, root []byte, l Loader, walkFn WalkNodeFunc) error + type Saver interface + Save func(ctx context.Context, data []byte) (reference []byte, err error) + type WalkFunc func(path []byte, isDir bool, err error) error + type WalkLevelFunc func(nodeType int, path, prefix, hash []byte, metadata map[string]string) error + type WalkNodeFunc func(path []byte, node *Node, err error) error