Skip to content

Commit

Permalink
update to use whosonfirst/go-cache v0.5.0 and friends
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisaaronland committed Jun 27, 2021
1 parent 682e4e3 commit 60067c4
Show file tree
Hide file tree
Showing 22 changed files with 348 additions and 305 deletions.
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ require (
github.com/rs/cors v1.7.0
github.com/sfomuseum/go-flags v0.8.2
github.com/tidwall/gjson v1.8.0
github.com/whosonfirst/go-cache v0.4.0
github.com/whosonfirst/go-cache-blob v0.1.2
github.com/whosonfirst/go-cache v0.5.0
github.com/whosonfirst/go-cache-blob v0.2.0
github.com/whosonfirst/go-ioutil v1.0.0
github.com/whosonfirst/go-reader v0.5.0
github.com/whosonfirst/go-whosonfirst-iterate v1.1.2
github.com/whosonfirst/go-whosonfirst-uri v1.0.1
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,12 @@ github.com/whosonfirst/go-cache v0.3.0 h1:QwboIxWu3Ab2gPikTMAJT2kukRr5c5yr/+yoMF
github.com/whosonfirst/go-cache v0.3.0/go.mod h1:uYn6IpxBxuSdULs15zkHHkOHTW8i4AS4A3jTv8wcbGg=
github.com/whosonfirst/go-cache v0.4.0 h1:KTUA6YHbsjh3bFIJpJ1+8uNJDwnaL5+3Et1dCj8xYBQ=
github.com/whosonfirst/go-cache v0.4.0/go.mod h1:uYn6IpxBxuSdULs15zkHHkOHTW8i4AS4A3jTv8wcbGg=
github.com/whosonfirst/go-cache v0.5.0 h1:s8o2FafYxI1TGJGqwi3G0XVD5yY1dvzwSe9dE5C+KfA=
github.com/whosonfirst/go-cache v0.5.0/go.mod h1:YawO5K9kQa3XnrtdfwZ6OS4gwuO87S06FqIPblMqZf4=
github.com/whosonfirst/go-cache-blob v0.1.2 h1:i+b9t02UdJXvw+mPlUz1WbLYKsJ+TsnHVWFh3eCkMcc=
github.com/whosonfirst/go-cache-blob v0.1.2/go.mod h1:HIGjOdg1tGaIv5ADlsKb0gel992vrklmykoYJd+axC0=
github.com/whosonfirst/go-cache-blob v0.2.0 h1:IagILVwbUKEKrGjKmjs/wEb/Q28uwLp0fkYh+IsYnyc=
github.com/whosonfirst/go-cache-blob v0.2.0/go.mod h1:CXgKyLBwkinhTLnuPs7/HVxPr0DSWGL7UoZF0ehmszo=
github.com/whosonfirst/go-ioutil v0.0.1 h1:cCrEYen6NDvHfjzV2q4u/VB21u2kTOwDnUGRlMI8Z9o=
github.com/whosonfirst/go-ioutil v0.0.1/go.mod h1:2dS1vWdAIkiHDvDF8fYyjv6k2NISmwaIjJJeEDBEdvg=
github.com/whosonfirst/go-ioutil v1.0.0 h1:sYpgJx7Wsp76e7PFGa8KKQBvWQW3+HMCWSJbKdD5m14=
Expand Down
9 changes: 7 additions & 2 deletions repo/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"encoding/json"
"errors"
"github.com/whosonfirst/go-cache"
"github.com/whosonfirst/go-ioutil"
"github.com/whosonfirst/go-whosonfirst-findingaid"
"github.com/whosonfirst/go-whosonfirst-iterate/iterator"
"io"
Expand Down Expand Up @@ -118,15 +119,19 @@ func (fa *Indexer) IndexReader(ctx context.Context, fh io.Reader) error {
}

br := bytes.NewReader(enc)
br_cl := io.NopCloser(br)
rsc, err := ioutil.NewReadSeekCloser(br)

if err != nil {
return err
}

key, err := cacheKeyFromRelPath(rsp.URI)

if err != nil {
return err
}

_, err = fa.cache.Set(ctx, key, br_cl)
_, err = fa.cache.Set(ctx, key, rsc)

if err != nil {
return err
Expand Down
165 changes: 0 additions & 165 deletions repo/readercache.go

This file was deleted.

14 changes: 7 additions & 7 deletions vendor/github.com/whosonfirst/go-cache-blob/blob.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions vendor/github.com/whosonfirst/go-cache-blob/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion vendor/github.com/whosonfirst/go-cache-blob/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions vendor/github.com/whosonfirst/go-cache-blob/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 60067c4

Please sign in to comment.