SkillAgentSearch skills...

Htree

Package htree implements the in-memory hash tree. Hacker News: https://news.ycombinator.com/item?id=11369676

Install / Use

/learn @hit9/Htree
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

HTree

Package htree implements the in-memory hash tree.

https://pkg.go.dev/github.com/hit9/htree

Example

package main

import (
	"fmt"
	"github.com/hit9/htree"
)

// Item implements htree.Item.
type Item struct {
	key   uint32
	value string
}

// Key returns the item key.
func (item Item) Key() uint32 {
	return item.key
}

func main() {
	t := htree.New()
	// Add an item.
	item := t.Put(Item{123, "data1"})
	// Get an item.
	item = t.Get(Item{key: 123})
	fmt.Println(item)
}

License

BSD.

Related Skills

View on GitHub
GitHub Stars92
CategoryDevelopment
Updated2y ago
Forks5

Languages

Go

Security Score

80/100

Audited on Oct 10, 2023

No findings