mirror of
https://github.com/willnorris/imageproxy.git
synced 2024-12-16 21:56:43 -05:00
sort cache select cases
This commit is contained in:
parent
a4304294da
commit
db55cb60f8
1 changed files with 4 additions and 4 deletions
|
@ -111,18 +111,18 @@ func parseCache() (imageproxy.Cache, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
switch u.Scheme {
|
switch u.Scheme {
|
||||||
case "s3":
|
|
||||||
return s3cache.New(u.String())
|
|
||||||
case "gcs":
|
|
||||||
return gcscache.New(u.String()), nil
|
|
||||||
case "azure":
|
case "azure":
|
||||||
return azurestoragecache.New("", "", u.Host)
|
return azurestoragecache.New("", "", u.Host)
|
||||||
|
case "gcs":
|
||||||
|
return gcscache.New(u.String()), nil
|
||||||
case "redis":
|
case "redis":
|
||||||
conn, err := redis.DialURL(u.String(), redis.DialPassword(os.Getenv("REDIS_PASSWORD")))
|
conn, err := redis.DialURL(u.String(), redis.DialPassword(os.Getenv("REDIS_PASSWORD")))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return rediscache.NewWithClient(conn), nil
|
return rediscache.NewWithClient(conn), nil
|
||||||
|
case "s3":
|
||||||
|
return s3cache.New(u.String())
|
||||||
case "file":
|
case "file":
|
||||||
fallthrough
|
fallthrough
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue