https://github.com/jmank88/nuts
A collections of BoltDB utilities
https://github.com/jmank88/nuts
boltdb go golang router
Last synced: about 1 year ago
JSON representation
A collections of BoltDB utilities
- Host: GitHub
- URL: https://github.com/jmank88/nuts
- Owner: jmank88
- License: mit
- Created: 2017-03-29T16:50:48.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T04:15:43.000Z (over 3 years ago)
- Last Synced: 2025-03-19T03:57:00.577Z (about 1 year ago)
- Topics: boltdb, go, golang, router
- Language: Go
- Size: 20.5 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nuts - BoltDB Utilities
[](https://godoc.org/github.com/jmank88/nuts) [](https://goreportcard.com/report/github.com/jmank88/nuts) [](https://coveralls.io/github/jmank88/nuts?branch=master)
A collection of [BoltDB](https://github.com/boltdb/bolt) utilities.
## Path Prefix Scans
The prefix scanning functions `SeekPathConflict` and `SeekPathMatch` facilitate maintenance and access to buckets of
paths supporting *variable elements* with *exclusive matches*. Paths are `/` delimited, must begin with a `/`, and
elements beginning with `:` or `*` are variable.
Examples:
```
/
/blogs/
/blogs/:blog_id
```
### Variable Elements
Path elements beginning with a `:` match any single element. Path elements beginning with `*` match any remaining
elements, and therefore must be last.
Examples:
```
Path: /blogs/:blog_id
Match: /blogs/someblog
```
```
Path: /blogs/:blog_id/comments/:comment_id/*suffix
Match: /blogs/42/comments/100/edit
```
### Exclusive Matches
Using `SeekPathConflict` before putting new paths to ensure the bucket remains conflict-free guarantees that `SeekPathMatch`
will never match more than one path.
Examples:
```
Conflicts: `/blogs/:blog_id`, `/blogs/golang`
Match: `/blogs/golang`
```
```
Conflicts: `/blogs/*`, `/blogs/:blog_id/comments`
Match: `/blogs/42/comments`
```