From 3e59e3b8329067d209da4203f3b7c77fc907e9d4 Mon Sep 17 00:00:00 2001 From: Paulo Costa Date: Wed, 19 Apr 2023 18:28:23 -0300 Subject: [PATCH 1/2] Add go.mod --- go.mod | 15 +++++++++++++++ go.sum | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 go.mod create mode 100644 go.sum diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..013e617 --- /dev/null +++ b/go.mod @@ -0,0 +1,15 @@ +module github.com/gregjones/httpcache + +go 1.20 + +require ( + github.com/bradfitz/gomemcache v0.0.0-20230124162541-5f7a7d875746 + github.com/gomodule/redigo v1.8.9 + github.com/peterbourgon/diskv v2.0.1+incompatible + github.com/syndtr/goleveldb v1.0.0 +) + +require ( + github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect + github.com/google/btree v1.1.2 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..69e04d3 --- /dev/null +++ b/go.sum @@ -0,0 +1,44 @@ +github.com/bradfitz/gomemcache v0.0.0-20230124162541-5f7a7d875746 h1:wAIE/kN63Oig1DdOzN7O+k4AbFh2cCJoKMFXrwRJtzk= +github.com/bradfitz/gomemcache v0.0.0-20230124162541-5f7a7d875746/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/gomodule/redigo v1.8.9 h1:Sl3u+2BI/kk+VEatbj0scLdrFhjPmbxOc1myhDP41ws= +github.com/gomodule/redigo v1.8.9/go.mod h1:7ArFNvsTjH8GMMzB4uy1snslv2BwmginuMs06a1uzZE= +github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= +github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE= +github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e h1:o3PsSEY8E4eXWkXrIP9YJALUkVZqzHJT5DOasTyn8Vs= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From ea496e704f735c5dc8d9851e97ccd20fbdd35875 Mon Sep 17 00:00:00 2001 From: Paulo Costa Date: Thu, 20 Apr 2023 14:07:33 -0300 Subject: [PATCH 2/2] Rename package -- gregjones/httpcache has been archieved and won't take PRs --- README.md | 10 ++++------ diskcache/diskcache_test.go | 2 +- go.mod | 2 +- leveldbcache/leveldbcache_test.go | 2 +- memcache/appengine_test.go | 4 ++-- memcache/memcache_test.go | 3 ++- redis/redis.go | 2 +- redis/redis_test.go | 2 +- test/test.go | 2 +- test/test_test.go | 4 ++-- 10 files changed, 16 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 51e7d23..e3e499a 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,20 @@ httpcache ========= -[![Build Status](https://travis-ci.org/gregjones/httpcache.svg?branch=master)](https://travis-ci.org/gregjones/httpcache) [![GoDoc](https://godoc.org/github.com/gregjones/httpcache?status.svg)](https://godoc.org/github.com/gregjones/httpcache) +This is a fork of https://github.com/gregjones/httpcache, which isn't actively maintained Package httpcache provides a http.RoundTripper implementation that works as a mostly [RFC 7234](https://tools.ietf.org/html/rfc7234) compliant cache for http responses. It is only suitable for use as a 'private' cache (i.e. for a web-browser or an API-client and not for a shared proxy). -This project isn't actively maintained; it works for what I, and seemingly others, want to do with it, and I consider it "done". That said, if you find any issues, please open a Pull Request and I will try to review it. Any changes now that change the public API won't be considered. - Cache Backends -------------- - The built-in 'memory' cache stores responses in an in-memory map. -- [`github.com/gregjones/httpcache/diskcache`](https://github.com/gregjones/httpcache/tree/master/diskcache) provides a filesystem-backed cache using the [diskv](https://github.com/peterbourgon/diskv) library. -- [`github.com/gregjones/httpcache/memcache`](https://github.com/gregjones/httpcache/tree/master/memcache) provides memcache implementations, for both App Engine and 'normal' memcache servers. +- [`github.com/slashid/httpcache/diskcache`](https://github.com/slashid/httpcache/tree/master/diskcache) provides a filesystem-backed cache using the [diskv](https://github.com/peterbourgon/diskv) library. +- [`github.com/slashid/httpcache/memcache`](https://github.com/slashid/httpcache/tree/master/memcache) provides memcache implementations, for both App Engine and 'normal' memcache servers. - [`sourcegraph.com/sourcegraph/s3cache`](https://sourcegraph.com/github.com/sourcegraph/s3cache) uses Amazon S3 for storage. -- [`github.com/gregjones/httpcache/leveldbcache`](https://github.com/gregjones/httpcache/tree/master/leveldbcache) provides a filesystem-backed cache using [leveldb](https://github.com/syndtr/goleveldb/leveldb). +- [`github.com/slashid/httpcache/leveldbcache`](https://github.com/slashid/httpcache/tree/master/leveldbcache) provides a filesystem-backed cache using [leveldb](https://github.com/syndtr/goleveldb/leveldb). - [`github.com/die-net/lrucache`](https://github.com/die-net/lrucache) provides an in-memory cache that will evict least-recently used entries. - [`github.com/die-net/lrucache/twotier`](https://github.com/die-net/lrucache/tree/master/twotier) allows caches to be combined, for example to use lrucache above with a persistent disk-cache. - [`github.com/birkelund/boltdbcache`](https://github.com/birkelund/boltdbcache) provides a BoltDB implementation (based on the [bbolt](https://github.com/coreos/bbolt) fork). diff --git a/diskcache/diskcache_test.go b/diskcache/diskcache_test.go index 98e168b..4c2b339 100644 --- a/diskcache/diskcache_test.go +++ b/diskcache/diskcache_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/gregjones/httpcache/test" + "github.com/slashid/httpcache/test" ) func TestDiskCache(t *testing.T) { diff --git a/go.mod b/go.mod index 013e617..2ef8541 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/gregjones/httpcache +module github.com/slashid/httpcache go 1.20 diff --git a/leveldbcache/leveldbcache_test.go b/leveldbcache/leveldbcache_test.go index e301e7b..e1e5809 100644 --- a/leveldbcache/leveldbcache_test.go +++ b/leveldbcache/leveldbcache_test.go @@ -6,7 +6,7 @@ import ( "path/filepath" "testing" - "github.com/gregjones/httpcache/test" + "github.com/slashid/httpcache/test" ) func TestDiskCache(t *testing.T) { diff --git a/memcache/appengine_test.go b/memcache/appengine_test.go index f46c379..bef1520 100644 --- a/memcache/appengine_test.go +++ b/memcache/appengine_test.go @@ -1,4 +1,4 @@ -// +build appengine +//go:build appengine package memcache @@ -6,7 +6,7 @@ import ( "testing" "appengine/aetest" - "github.com/gregjones/httpcache/test" + "github.com/slashid/httpcache/test" ) func TestAppEngine(t *testing.T) { diff --git a/memcache/memcache_test.go b/memcache/memcache_test.go index cce9e02..bb4e023 100644 --- a/memcache/memcache_test.go +++ b/memcache/memcache_test.go @@ -1,3 +1,4 @@ +//go:build !appengine // +build !appengine package memcache @@ -6,7 +7,7 @@ import ( "net" "testing" - "github.com/gregjones/httpcache/test" + "github.com/slashid/httpcache/test" ) const testServer = "localhost:11211" diff --git a/redis/redis.go b/redis/redis.go index 3d69c6c..52adade 100644 --- a/redis/redis.go +++ b/redis/redis.go @@ -3,7 +3,7 @@ package redis import ( "github.com/gomodule/redigo/redis" - "github.com/gregjones/httpcache" + "github.com/slashid/httpcache" ) // cache is an implementation of httpcache.Cache that caches responses in a diff --git a/redis/redis_test.go b/redis/redis_test.go index 800863c..184f1ef 100644 --- a/redis/redis_test.go +++ b/redis/redis_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/gomodule/redigo/redis" - "github.com/gregjones/httpcache/test" + "github.com/slashid/httpcache/test" ) func TestRedisCache(t *testing.T) { diff --git a/test/test.go b/test/test.go index c2ff257..0ddb2a6 100644 --- a/test/test.go +++ b/test/test.go @@ -4,7 +4,7 @@ import ( "bytes" "testing" - "github.com/gregjones/httpcache" + "github.com/slashid/httpcache" ) // Cache excercises a httpcache.Cache implementation. diff --git a/test/test_test.go b/test/test_test.go index 41a9c20..9f0229a 100644 --- a/test/test_test.go +++ b/test/test_test.go @@ -3,8 +3,8 @@ package test_test import ( "testing" - "github.com/gregjones/httpcache" - "github.com/gregjones/httpcache/test" + "github.com/slashid/httpcache" + "github.com/slashid/httpcache/test" ) func TestMemoryCache(t *testing.T) {