rafaeljesus / tempdb

Key-value store for temporary items :memo:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Installation

go get -u github.com/rafaeljesus/tempdb

Usage

Tempdb stores an expiring (or non-expiring) key/value pair in Redis.

Tempdb

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 Go Report Card Go Doc


GitHub @rafaeljesus  ·  Medium @_jesus_rafael  ·  Twitter @_jesus_rafael

About

Key-value store for temporary items :memo:

License:MIT License


Languages

Language:Go 98.0%Language:Makefile 2.0%