https://github.com/purehyperbole/art
an Adaptive Radix Tree implementation in go
https://github.com/purehyperbole/art
adaptive-radix-tree golang radix radix-tree thread-safe
Last synced: about 1 month ago
JSON representation
an Adaptive Radix Tree implementation in go
- Host: GitHub
- URL: https://github.com/purehyperbole/art
- Owner: purehyperbole
- License: mit
- Created: 2019-10-04T19:30:44.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-11-03T09:56:39.000Z (almost 4 years ago)
- Last Synced: 2025-03-29T05:35:48.355Z (6 months ago)
- Topics: adaptive-radix-tree, golang, radix, radix-tree, thread-safe
- Language: Go
- Size: 54.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Art [](https://godoc.org/github.com/purehyperbole/art) [](https://goreportcard.com/report/github.com/purehyperbole/art) [](https://travis-ci.org/purehyperbole/art)
A thread safe Adaptive Radix Tree implementation in go
# Installation
To start using art, you can run:
`$ go get github.com/purehyperbole/art`
# Usage
To create a new radix tree
```go
package mainimport (
"github.com/purehyperbole/art"
)func main() {
// create a new art tree
r := art.New()
}
````Lookup` can be used to retrieve a stored value
```go
value := r.Lookup([]byte("myKey1234"))
````Insert` allows a value to be stored for a given key.
```go
r.Insert([]byte("key"), &Thing{12345})
````Iterate` allows for iterating keys in the tree
```go
// 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{}) {
...
})
```## Why?
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).
## Versioning
For transparency into our release cycle and in striving to maintain backward
compatibility, this project is maintained under [the Semantic Versioning guidelines](http://semver.org/).## Copyright and License
Code and documentation copyright since 2019 purehyperbole.
Code released under
[the MIT License](LICENSE).