https://github.com/nektro/go.sdrie
An in-process key/value store for data with expiration dates in Go
https://github.com/nektro/go.sdrie
datastore golang thread-safe
Last synced: about 1 year ago
JSON representation
An in-process key/value store for data with expiration dates in Go
- Host: GitHub
- URL: https://github.com/nektro/go.sdrie
- Owner: nektro
- License: mit
- Created: 2019-02-17T10:05:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-04-07T21:10:14.000Z (about 6 years ago)
- Last Synced: 2025-03-25T22:51:33.320Z (about 1 year ago)
- Topics: datastore, golang, thread-safe
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sdrie

[](https://github.com/nektro/go.sdrie/blob/master/LICENSE)
[](https://discord.gg/P6Y4zQC)
[](https://paypal.me/nektro)
[](https://goreportcard.com/report/github.com/nektro/go.sdrie)
An in-process key/value store for data with expiration dates in Go
## Installing
```
$ go get -u github.com/nektro/sdrie
```
## Usage
### `sdrie.New`
- `New() SdrieDataStore`
- `New` returns a new instance of a `SdrieDataStore`.
### `SdrieDataStore.Set`
- `Set(key string, value string, lifespan time.Duration)`
- `Set` adds `value` to the data store associated to `key` and will survive for `lifespan` seconds.
### `SdrieDataStore.Get`
- `Get(key string) interface{}`
- `Get` retrieves the value associated to `key`, or `nil` otherwise.
### `SdrieDataStore.Has`
- `Has(key string) bool`
- `Has` returns a `bool` based on whether or not `key` exists in the data store.
## Contributing
We take issues all the time right here on GitHub. We use labels extensively to show the progress through the fixing process. Question issues are okay but make sure to close the issue when it's been answered!
[](https://github.com/nektro/sdrie/issues)
When making a pull request, please have it be associated with an issue and make a comment on the issue saying that you're working on it so everyone else knows what's going on :D
[](https://github.com/nektro/sdrie/pulls)
## Contact
- hello@nektro.net
- Meghan#2032 on discordapp.com
- @nektro on [twitter.com](https://twitter.com/nektro)
## License
MIT