MCPcopy
hub / github.com/redis/go-redis / ParseFailoverURL

Function ParseFailoverURL

sentinel.go:391–397  ·  view source on GitHub ↗

ParseFailoverURL parses a URL into FailoverOptions that can be used to connect to Redis. The URL must be in the form: redis://<user>:<password>@<host>:<port>/<db_number> or rediss://<user>:<password>@<host>:<port>/<db_number> To add additional addresses, specify the query parameter, "addr" one

(redisURL string)

Source from the content-addressed store, hash-verified

389// ReadTimeout: 6 * time.Second,
390// }
391func ParseFailoverURL(redisURL string) (*FailoverOptions, error) {
392 u, err := url.Parse(redisURL)
393 if err != nil {
394 return nil, err
395 }
396 return setupFailoverConn(u)
397}
398
399func setupFailoverConn(u *url.URL) (*FailoverOptions, error) {
400 o := &FailoverOptions{}

Callers

nothing calls this directly

Calls 1

setupFailoverConnFunction · 0.85

Tested by

no test coverage detected