Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't conect to redis server remote #210

Open
Nghiait123456 opened this issue Mar 27, 2022 · 1 comment
Open

don't conect to redis server remote #210

Nghiait123456 opened this issue Mar 27, 2022 · 1 comment

Comments

@Nghiait123456
Copy link

Nghiait123456 commented Mar 27, 2022

if connect redis pool, ex:
"""var redisPool = &redis.Pool{
MaxActive: 5,
MaxIdle: 5,
Wait: true,
Dial: func() (redis.Conn, error) {
return redis.Dial("tcp", ":6379")
},
}"""

folow line Dial: func() (redis.Conn, error) {
return redis.Dial("tcp", ":6379")
},
if i can connect to redis remote, i need to add more param to "return redis.Dial("tcp", ":6379")"

but you view source redis.Dial(), in param options ...DialOption:

"""func Dial(network, address string, options ...DialOption) (Conn, error) { .......}"""

and DialOption source:
// DialOption specifies an option for dialing a Redis server.
"""type DialOption struct {
f func(*dialOptions)
}"""

clearly, dialOptions is not public, how to pass dialOptions to this function f func(*dialOptions),
please helpme clearly this problem

@vaguecoder
Copy link

Not used redigo but from what I see, there are 14 functions with input arguments including anonymous function that create a DialOption. Have you tried them?
https://pkg.go.dev/github.com/gomodule/redigo/redis#pkg-index

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants