gocolly / redisstorage Goto Github PK
View Code? Open in Web Editor NEWRedis based storage backend for Colly
Home Page: https://godoc.org/github.com/gocolly/redisstorage
License: Apache License 2.0
Redis based storage backend for Colly
Home Page: https://godoc.org/github.com/gocolly/redisstorage
License: Apache License 2.0
Cannot use 'rdb.Redis' (type *"github.com/go-redis/redis/v8".Client) as type *"github.com/go-redis/redis".Client
I tried with simple example using colly V2, but I get the following error:
cannot use storage (variable of type *redisstorage.Storage) as storage.Storage value in argument to c.SetStorage: wrong type for method Cookies (have func(u *net/url.URL) string, want func(u *net/url.URL) string)compiler[InvalidIfaceAssign](https://pkg.go.dev/golang.org/x/tools/internal/typesinternal?utm_source%3Dgopls#InvalidIfaceAssign)
Example
import (
"github.com/gocolly/colly/v2"
"github.com/gocolly/redisstorage"
)
c := colly.NewCollector()
storage := &redisstorage.Storage{
Address: "127.0.0.1:6379",
Password: "",
DB: 0,
Prefix: "job01",
}
err := c.SetStorage(storage)
if err != nil {
panic(err)
}
Any suggestions how to fix this issue?
`# github.com/gocolly/redisstorage
..\github.com\gocolly\redisstorage\redisstorage.go:43:25: not enough arguments in call to s.Client.cmdable.Ping
have ()
want (context.Context)
..\github.com\gocolly\redisstorage\redisstorage.go:54:20: not enough arguments in call to s.Client.cmdable.Keys
have (string)
want (context.Context, string)
..\github.com\gocolly\redisstorage\redisstorage.go:59:21: not enough arguments in call to s.Client.cmdable.Keys
have (string)
want (context.Context, string)
..\github.com\gocolly\redisstorage\redisstorage.go:66:21: not enough arguments in call to s.Client.cmdable.Del
have ([]string...)
want (context.Context, ...string)
..\github.com\gocolly\redisstorage\redisstorage.go:71:21: not enough arguments in call to s.Client.cmdable.Set
have (string, string, time.Duration)
want (context.Context, string, interface {}, time.Duration)
..\github.com\gocolly\redisstorage\redisstorage.go:76:24: not enough arguments in call to s.Client.cmdable.Get
have (string)
want (context.Context, string)
..\github.com\gocolly\redisstorage\redisstorage.go:96:21: not enough arguments in call to s.Client.cmdable.Set
have (string, string, number)
want (context.Context, string, interface {}, time.Duration)
..\github.com\gocolly\redisstorage\redisstorage.go:109:33: not enough arguments in call to s.Client.cmdable.Get
have (string)
want (context.Context, string)
..\github.com\gocolly\redisstorage\redisstorage.go:123:36: cannot use s.getQueueID() (type string) as type context.Context in argument to s.Client.cmdable.RPush:
string does not implement context.Context (missing Deadline method)
..\github.com\gocolly\redisstorage\redisstorage.go:123:36: cannot use r (type []byte) as type string in argument to s.Client.cmdable.RPush
..\github.com\gocolly\redisstorage\redisstorage.go:123:36: too many errors
Compilation finished with exit code 2
`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.