A thread safe Adaptive Radix Tree implementation in go
To start using art, you can run:
$ go get github.com/purehyperbole/art
To create a new radix tree
package main
import (
"github.com/purehyperbole/art"
)
func main() {
// create a new art tree
r := art.New()
}
Lookup
can be used to retrieve a stored value
value := r.Lookup([]byte("myKey1234"))
Insert
allows a value to be stored for a given key.
r.Insert([]byte("key"), &Thing{12345})
Iterate
allows for iterating keys in the tree
// iterate over all keys
r.Iterate(nil, func(key []byte, value interface{}) {
...
})
// iterate over all subkeys of "art"
r.Iterate([]byte("art"), func(key []byte, value interface{}) {
...
})
This project was created to explore the performance tradeoffs of a more memory efficient radix tree with my other lock free implementation (github.com/purehyperbole/rad).
For transparency into our release cycle and in striving to maintain backward compatibility, this project is maintained under the Semantic Versioning guidelines.
Code and documentation copyright since 2019 purehyperbole.
Code released under the MIT License.