Skip to content

A redis store for colly use latest go-redis package.

License

Notifications You must be signed in to change notification settings

hack-fan/collyredis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Colly Redis Store

A redis store for colly use latest go-redis package.

Because the official one 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.

Install

go get -u github.com/hack-fan/colly-redis

Usage

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)
}

About

A redis store for colly use latest go-redis package.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages