Skip to content

Commit

Permalink
update vendor deps
Browse files Browse the repository at this point in the history
  • Loading branch information
whosonfirst committed Aug 11, 2022
1 parent ce57a24 commit ab10cfb
Show file tree
Hide file tree
Showing 339 changed files with 26,060 additions and 23,051 deletions.
26 changes: 8 additions & 18 deletions blob.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package blob

import (
"bufio"
"bytes"
"context"
wof_cache "github.com/whosonfirst/go-cache"
"github.com/whosonfirst/go-ioutil"
Expand Down Expand Up @@ -70,7 +68,7 @@ func (c *BlobCache) Get(ctx context.Context, key string) (io.ReadSeekCloser, err
return ioutil.NewReadSeekCloser(fh)
}

func (c *BlobCache) Set(ctx context.Context, key string, fh io.ReadSeekCloser) (io.ReadSeekCloser, error) {
func (c *BlobCache) Set(ctx context.Context, key string, r io.ReadSeekCloser) (io.ReadSeekCloser, error) {

var wr_opts *blob.WriterOptions

Expand All @@ -86,19 +84,6 @@ func (c *BlobCache) Set(ctx context.Context, key string, fh io.ReadSeekCloser) (
return nil, err
}

// this is not awesome but until we update all the things (and
// in particular all the go-whosonfirst-readwrite stuff) to be
// ReadSeekCloser thingies it's what necessary...
// (20180617/thisisaaronland)

var b bytes.Buffer
wr := bufio.NewWriter(&b)

io.Copy(wr, fh)
wr.Flush()

r := bytes.NewReader(b.Bytes())

_, err = io.Copy(bucket_wr, r)

if err != nil {
Expand All @@ -113,8 +98,13 @@ func (c *BlobCache) Set(ctx context.Context, key string, fh io.ReadSeekCloser) (

atomic.AddInt64(&c.sets, 1)

r.Reset(b.Bytes())
return ioutil.NewReadSeekCloser(r)
_, err = r.Seek(0, 0)

if err != nil {
return nil, err
}

return r, nil
}

func (c *BlobCache) Unset(ctx context.Context, key string) error {
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/whosonfirst/go-cache-blob
go 1.16

require (
github.com/whosonfirst/go-cache v0.5.0
github.com/whosonfirst/go-ioutil v1.0.0
gocloud.dev v0.23.0
github.com/whosonfirst/go-cache v0.5.1
github.com/whosonfirst/go-ioutil v1.0.2
gocloud.dev v0.26.0
)
572 changes: 389 additions & 183 deletions go.sum

Large diffs are not rendered by default.

127 changes: 127 additions & 0 deletions vendor/github.com/aaronland/go-roster/README.md

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

13 changes: 10 additions & 3 deletions vendor/github.com/aaronland/go-roster/default.go

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/aaronland/go-roster/doc.go

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

2 changes: 1 addition & 1 deletion vendor/github.com/aaronland/go-roster/go.mod

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

6 changes: 6 additions & 0 deletions vendor/github.com/aaronland/go-roster/roster.go

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

Loading

0 comments on commit ab10cfb

Please sign in to comment.