An in-process key/value store for data with expiration dates in Go
$ go get -u github.com/nektro/sdrie
New(cleanupTriggerThreshold int) SdrieDataStore
New
returns a new instance of aSdrieDataStore
- Once the size of data-store reaches
cleanupTriggerThreshold
, each subsequent operation attempts a cleanup of expired keys - Passing 0 or negative integer in
cleanupTriggerThreshold
sets it to default value of 1000
Set(key string, value string, lifespan int64)
Set
addsvalue
to the data store associated tokey
and will survive forlifespan
milliseconds.
Get(key string) interface{}
Get
retrieves the value associated tokey
, ornil
otherwise.
Has(key string) bool
Has
returns abool
based on whether or notkey
exists in the data store.
Delete(key string)
Delete
retrieves the value associated tokey
or 'no-op' if key doesn't exist
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!
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
- hello@nektro.net
- Meghan#2032 on discordapp.com
- @nektro on twitter.com
MIT