https://github.com/hack-fan/collyredis
A redis store for colly use latest go-redis package.
https://github.com/hack-fan/collyredis
Last synced: 4 months ago
JSON representation
A redis store for colly use latest go-redis package.
- Host: GitHub
- URL: https://github.com/hack-fan/collyredis
- Owner: hack-fan
- License: mit
- Created: 2021-04-16T03:07:02.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-17T14:51:38.000Z (about 5 years ago)
- Last Synced: 2024-06-20T08:20:44.349Z (almost 2 years ago)
- Language: Go
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Colly Redis Store
A redis store for colly use latest go-redis package.
Because the [official one](https://github.com/gocolly/redisstorage)
seems no longer being maintained.
It is hard to make a pull request for it,
since the new go-redis client will break the old api.
The logic code of this package is not change, thanks for
[gocolly/redisstorage](https://github.com/gocolly/redisstorage).
## Install
```
go get -u github.com/hack-fan/colly-redis
```
## Usage
```go
import (
"github.com/gocolly/colly"
"github.com/hack-fan/collyredis"
"github.com/go-redis/redis/v8"
)
// Make your any kind of go-redis client
rdb := redis.NewClient(&redis.Options{
Addr: "localhost:6379",
Password: "", // no password set
DB: 0, // use default DB
})
storage := collyredis.NewStorage(rdb)
c := colly.NewCollector()
err := c.SetStorage(storage)
if err != nil {
panic(err)
}
```