Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rafaeljesus/tempdb
Key-value store for temporary items :memo:
https://github.com/rafaeljesus/tempdb
go key-value redis
Last synced: 10 days ago
JSON representation
Key-value store for temporary items :memo:
- Host: GitHub
- URL: https://github.com/rafaeljesus/tempdb
- Owner: rafaeljesus
- License: mit
- Created: 2017-03-17T18:03:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-14T19:03:13.000Z (over 6 years ago)
- Last Synced: 2024-07-31T20:49:32.750Z (3 months ago)
- Topics: go, key-value, redis
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 19
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - tempdb - Key-value store for temporary items. (Database / Databases Implemented in Go)
- awesome-go - tempdb - Key-value store for temporary items - ★ 13 (Database)
- awesome-go-extra - tempdb - value store for temporary items :memo:|16|3|0|2017-03-17T18:03:42Z|2018-02-14T19:03:13Z| (Generators / Databases Implemented in Go)
README
## Tempdb
* TempDB is Redis-backed temporary key-value store for Go.
* Useful for storing temporary data such as login codes, authentication tokens, and temporary passwords.
* A Go version of [tempDB](https://github.com/shanev/tempdb)## Installation
```bash
go get -u github.com/rafaeljesus/tempdb
```## Usage
Tempdb stores an expiring (or non-expiring) key/value pair in Redis.### Tempdb
```go
import "github.com/rafaeljesus/tempdb"temp, err := tempdb.New(tempdb.Options{
Addr: "localhost:6379",
Password: "foo",
})if err = temp.Insert("key", "value", 0); err != nil {
// handle failure insert key
}if err = temp.Insert("key2", "value", time.Hour); err != nil {
// handle failure insert key
}if err = temp.Find("key"); err != nil {
// handle failure to get value
}```
## Contributing
- Fork it
- Create your feature branch (`git checkout -b my-new-feature`)
- Commit your changes (`git commit -am 'Add some feature'`)
- Push to the branch (`git push origin my-new-feature`)
- Create new Pull Request## Badges
[![Build Status](https://circleci.com/gh/rafaeljesus/tempdb.svg?style=svg)](https://circleci.com/gh/rafaeljesus/tempdb)
[![Go Report Card](https://goreportcard.com/badge/github.com/rafaeljesus/tempdb)](https://goreportcard.com/report/github.com/rafaeljesus/tempdb)
[![Go Doc](https://godoc.org/github.com/rafaeljesus/tempdb?status.svg)](https://godoc.org/github.com/rafaeljesus/tempdb)---
> GitHub [@rafaeljesus](https://github.com/rafaeljesus) ·
> Medium [@_jesus_rafael](https://medium.com/@_jesus_rafael) ·
> Twitter [@_jesus_rafael](https://twitter.com/_jesus_rafael)