diff --git a/README.md b/README.md index 7d2d6c1..01d6a0d 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,9 @@ enabled using the `-cache` flag. It supports the following values: images on Amazon S3. This requires either an IAM role and instance profile with access to your your bucket or `AWS_ACCESS_KEY_ID` and `AWS_SECRET_KEY` environmental parameters set. + - GCS URL (e.g. `gcs://bucket-name/optional-path-prefix`) - will cache + images on Google Cloud Storage. This requires `GCP_PRIVATE_KEY` environmental + parameters set. For example, to cache files on disk in the `/tmp/imageproxy` directory: diff --git a/cmd/imageproxy/main.go b/cmd/imageproxy/main.go index 396ca12..71d7d77 100644 --- a/cmd/imageproxy/main.go +++ b/cmd/imageproxy/main.go @@ -24,6 +24,7 @@ import ( "net/url" "strings" + "github.com/diegomarangoni/gcscache" "github.com/gregjones/httpcache" "github.com/gregjones/httpcache/diskcache" "github.com/peterbourgon/diskv" @@ -126,6 +127,8 @@ func parseCache() (imageproxy.Cache, error) { case "s3": u.Scheme = "https" return s3cache.New(u.String()), nil + case "gcs": + return gcscache.New(u.String()), nil case "file": fallthrough default: