Skip to content

Commit d2e5b89

Browse files
- update readme with other useful packages
1 parent 0c6741a commit d2e5b89

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Caching Slow Database Queries [![GoDoc](http://godoc.org/github.com/rocketlaunchr/remember-go?status.svg)](http://godoc.org/github.com/rocketlaunchr/remember-go) [![Go Report Card](https://goreportcard.com/badge/github.com/rocketlaunchr/remember-go)](https://goreportcard.com/report/github.com/rocketlaunchr/remember-go) [![GoCover](https://gocover.io/_badge/github.com/rocketlaunchr/remember-go)](https://gocover.io/github.com/rocketlaunchr/remember-go)
2-
===============
1+
# Caching Slow Database Queries [![GoDoc](http://godoc.org/github.com/rocketlaunchr/remember-go?status.svg)](http://godoc.org/github.com/rocketlaunchr/remember-go) [![Go Report Card](https://goreportcard.com/badge/github.com/rocketlaunchr/remember-go)](https://goreportcard.com/report/github.com/rocketlaunchr/remember-go) [![GoCover](https://gocover.io/_badge/github.com/rocketlaunchr/remember-go)](https://gocover.io/github.com/rocketlaunchr/remember-go)
32

43
This package is used to cache the results of slow database queries in memory or Redis.
54
It can be used to cache any form of data. A Redis and in-memory storage driver is provided.
@@ -16,7 +15,6 @@ The package is **production ready** and the API is stable. A variant of this pac
1615
go get -u github.com/rocketlaunchr/remember-go
1716
```
1817

19-
2018
## Create a Key
2119

2220
Let’s assume the query’s argument is an arbitrary `search` term and a `page` number for pagination.
@@ -34,7 +32,6 @@ type Key struct {
3432
var key string = remember.CreateKeyStruct(Key{"golang", 2})
3533
```
3634

37-
3835
### CreateKey
3936

4037
CreateKey provides more flexibility to generate keys:
@@ -59,9 +56,9 @@ The Redis storage driver relies on Gary Burd’s excellent [Redis client library
5956

6057
```go
6158
var rs = red.NewRedisStore(&redis.Pool{
62-
Dial: func() (redis.Conn, error) {
63-
return redis.Dial("tcp", "localhost:6379")
64-
},
59+
Dial: func() (redis.Conn, error) {
60+
return redis.Dial("tcp", "localhost:6379")
61+
},
6562
})
6663
```
6764

@@ -112,10 +109,10 @@ slowQuery := func(ctx context.Context) (interface{}, error) {
112109

113110
```go
114111
import (
115-
"github.com/gomodule/redigo/redis"
116-
"github.com/rocketlaunchr/remember-go"
117-
"github.com/rocketlaunchr/remember-go/memory"
118-
red "github.com/rocketlaunchr/remember-go/redis"
112+
"github.com/gomodule/redigo/redis"
113+
"github.com/rocketlaunchr/remember-go"
114+
"github.com/rocketlaunchr/remember-go/memory"
115+
red "github.com/rocketlaunchr/remember-go/redis"
119116
)
120117

121118

@@ -130,8 +127,15 @@ return results.([]Result) // Type assert in order to use
130127

131128
## Gob Register Errors
132129

133-
The Redis storage driver stores the data in a `gob` encoded form. You have to register with the gob package the data type returned by the `SlowRetrieve` function. It can be done inside a `func init()`. Alternatively, you can set the `GobRegister` option to true. This will slightly impact concurrency performance however.
130+
The Redis storage driver stores the data in a [`gob`](https://golang.org/pkg/encoding/gob/) encoded form. You have to register with the gob package the data type returned by the `SlowRetrieve` function. It can be done inside a `func init()`. Alternatively, you can set the `GobRegister` option to true. This will slightly impact concurrency performance however.
131+
132+
## Other useful packages
134133

134+
- [dataframe-go](https://github.com/rocketlaunchr/remember-go) - Statistics and data manipulation
135+
- [dbq](https://github.com/rocketlaunchr/dbq) - Zero boilerplate database operations for Go
136+
- [igo](https://github.com/rocketlaunchr/igo) - A Go transpiler with cool new syntax such as `fordefer` (defer for for-loops)
137+
- [mysql-go](https://github.com/rocketlaunchr/mysql-go) - Properly cancel slow MySQL queries
138+
- [react](https://github.com/rocketlaunchr/react) - Build front end applications using Go
135139

136140
#
137141

0 commit comments

Comments
 (0)