Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gosuri/go-store
A simple and fast Redis backed key-value store library for Go
https://github.com/gosuri/go-store
Last synced: about 1 month ago
JSON representation
A simple and fast Redis backed key-value store library for Go
- Host: GitHub
- URL: https://github.com/gosuri/go-store
- Owner: gosuri
- License: apache-2.0
- Created: 2015-03-22T12:07:29.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-23T15:11:42.000Z (over 7 years ago)
- Last Synced: 2024-01-31T05:49:29.736Z (4 months ago)
- Language: Go
- Homepage:
- Size: 152 KB
- Stars: 112
- Watchers: 10
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Lists
- awesome-go - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- awesome-go - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- awesome-go-extra - go-store - value store library for Go|108|9|1|2015-03-22T12:07:29Z|2017-02-23T15:11:42Z| (ORM / HTTP Clients)
- awesome-go-cn - go-store - 简单快速的基于`Redis` 的键值对存储库 (网络相关库 / ORM)
- awesome-go-zh - go-store
- awesome-go - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- awesome-go-cn - go-store - store) [![godoc][D]](https://godoc.org/github.com/gosuri/go-store) (ORM / HTTP客户端)
- awesome-go - go-store - value store library for Go. | 93 | 8 | - | (ORM / HTTP Clients)
- fucking-awesome-go - :octocat: go-store - A simple and fast Redis backed key-value store library for Go. :star: 73 :fork_and_knife: 5 (ORM / Advanced Console UIs)
- awesome-go - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- awesome-go-projects - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- awesome-go - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- awesome-go - go-store - A simple and fast Redis backed key-value store library for Go. (ORM / Advanced Console UIs)
- awesome-go-with-framework - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- awesome-go - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- awesome-go-cn - go-store - store) [![godoc][D]](https://godoc.org/github.com/gosuri/go-store) (ORM / HTTP客户端)
- awesome-go-stars - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- zero-alloc-awesome-go - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- awesome-go - go-store - A simple and fast Redis backed key-value store library for Go. (ORM / Advanced Console UIs)
- awesome-go - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- awesome-go. - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / Advanced Console UIs)
- awesome-go - go-store - Simple and fast Redis backed key-value store library for Go. (<span id="orm">ORM</span> / <span id="高级控制台用户界面-advanced-console-uis">高级控制台用户界面 Advanced Console UIs</span>)
- awesome-go-with-stars - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- awesome-go - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- repo-1316-awesome-go-cn - go-store - store) [![godoc][D]](https://godoc.org/github.com/gosuri/go-store) (ORM / HTTP客户端)
- repo-1211-awesome-go-cn - go-store - store) [![godoc][D]](https://godoc.org/github.com/gosuri/go-store) (ORM / HTTP客户端)
- awesome-Char - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- awesome-reader - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- awesome-go - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- Go-awesome - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- awesome-go-cn - go-store - value store library for Go.) (ORM / Advanced Console UIs)
- awesome-go - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / Advanced Console UIs)
- awesome-go - go-store - A simple and fast Redis backed key-value store library for Go. (ORM / Advanced Console UIs)
- awesome-go-handwritten - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- awesome-go - go-store - A simple and fast Redis backed key-value store library for Go - ★ 90 (ORM)
- awesome-go2 - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / Advanced Console UIs)
- awesome-go - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- awesome-go - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- awesome-go - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- awesome-go - go-store - A simple and fast Redis backed key-value store library for Go. (ORM / Advanced Console UIs)
- awesome-go - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- awesome-go-cn - go-store
- awesome-go-zh - go-store - store) [![godoc][D]](https://godoc.org/github.com/gosuri/go-store) (ORM / HTTP客户端)
- awesome-go - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- awesome-go - go-store - Simple and fast Redis backed key-value store library for Go. (ORM / HTTP Clients)
- go-awesome-cn-star - go-store - 简单快速的基于`Redis` 的键值对存储库(107) (网络相关库 / OpenGL)
README
store [![GoDoc](https://godoc.org/github.com/gosuri/go-store?status.svg)](https://godoc.org/github.com/gosuri/go-store) [![Build Status](https://travis-ci.org/gosuri/go-store.svg?branch=master)](https://travis-ci.org/gosuri/go-store)
=======store is a data-store library for [Go](http://golang.org) that provides a set of platform-independent interfaces to persist and retrieve data.
Its primary goal is to wrap existing implementations of such primitives, such as those in package redis, into shared public interfaces that abstract functionality, plus some other related primitives.
It currently supports [Redis](http://redis.io) from the [redis](redis/) package.
**NOTE**: This library is currently under **active development** and not ready for production use.
Example
-------The below example stores, lists and fetches the saved records
```go
package mainimport (
"fmt""github.com/gosuri/go-store/redis"
)type hacker struct {
Id string
Name string
Birthyear int
}func (h *hacker) Key() string {
return h.Id
}func (h *hacker) SetKey(k string) {
h.Id = k
}func main() {
store, err := redis.NewStore("", "")
if err != nil {
panic(err) // handle error
}// Save a hacker in the store with a auto-generated uuid
if err := store.Write(&hacker{Name: "Alan Turing", Birthyear: 1912}); err != nil {
panic(err) // handle error
}var hackers []hacker
// Populate hackers slice with ids of all hackers in the store
store.List(&hackers)alan := hackers[0]
store.Read(&alan)
fmt.Println("Hello,", alan.Name)fmt.Println("Listing all", len(hackers), "hackers")
// Fetches all hackers with names from the store
store.ReadMultiple(hackers)
for _, h := range hackers {
fmt.Printf("%s (%d) (%s)\n", h.Name, h.Birthyear, h.Id)
}
}
```Roadmap
-------Below are items I am and plan on working on in the near future. Contributions are welcome.
Feature | Status
--- | ---
Save multiple records in a single call using pipelining | **implementing**
Query (using finders) and indexing |Contributing
------------### Dependency management
Users who import `store` into their package main are responsible to organize and maintain all of their dependencies to ensure code compatibility and build reproducibility.
Store makes no direct use of dependency management tools like [Godep](https://github.com/tools/godep).We will use a variety of continuous integration providers to find and fix compatibility problems as soon as they occur.
Running Testing
----------------```
$ make test
```Benchmarks
----------```
$ make benchmark
...
BenchmarkRedisWrite 10000 104302 ns/op
BenchmarkRead 20000 65870 ns/op
BenchmarkRead1k 20 67325041 ns/op
BenchmarkRedisList1k 50 27598338 ns/op
BenchmarkRedisList10k 30 71845057 ns/op
BenchmarkReadMultiple1k 200 7453783 ns/op
```