~tsileo/blobstash

a462ff8a59bd717b15652a7b787c336ed6a9bfe7 — Thomas Sileo 6 months ago 26e8db9
deps: update deps
8 files changed, 38 insertions(+), 26 deletions(-)

M go.mod
M go.sum
A vendor/a4.io/blobsfile/.build.yml
D vendor/a4.io/blobsfile/.travis.yml
M vendor/a4.io/blobsfile/README.md
M vendor/a4.io/blobsfile/blobsfile.go
M vendor/a4.io/blobsfile/go.mod
M vendor/modules.txt
M go.mod => go.mod +1 -1
@@ 3,7 3,7 @@ module a4.io/blobstash
replace github.com/go-interpreter/wagon v0.0.0 => github.com/perlin-network/wagon v0.3.1-0.20180825141017-f8cb99b55a39

require (
	a4.io/blobsfile v0.3.1
	a4.io/blobsfile v0.3.2
	a4.io/gluapp v0.0.0-20190530193846-2ad05291e3be
	a4.io/gluarequire2 v0.0.0-20170611121149-66e0eb2c6a9f
	a4.io/go/indieauth v1.0.0

M go.sum => go.sum +2 -0
@@ 4,6 4,8 @@ a4.io/blobsfile v0.1.0 h1:nE9v20zzfL7UKvZuA2J42ncYBCqZ9mgVU9am9+XZdZk=
a4.io/blobsfile v0.1.0/go.mod h1:kJFL3M8OxlvHZWzxZ6C9o+ky9iJHmx0jZj59nilWzJM=
a4.io/blobsfile v0.3.1 h1:7kcNkIS4wWyCLS+s4BIb86KdxtoC4BOt/KjCcFzJuwA=
a4.io/blobsfile v0.3.1/go.mod h1:Jy00okG1uHZQ5MN9WskYFFffuDFq4UbHNb0aWRqWo9c=
a4.io/blobsfile v0.3.2 h1:p+Wm8aOsV01kYhyJFCiNGga42fi+vAZ587ljb4bhK94=
a4.io/blobsfile v0.3.2/go.mod h1:ZHwdtHHOeCbaP/dpPnA1FAUrrwXG9GX2ju3OrbufCjQ=
a4.io/blobstash v0.0.0-20181216235946-aa2d4a59f200/go.mod h1:PVI3EM/VmUQAz7pbz/govGO4gHypTF5YWhS56qETj+M=
a4.io/blobstash v0.0.0-20181218201750-765e41187e8a/go.mod h1:QH1JUxPtdWiC/hCXrfzS03p5tX9mqALuBzUd2yYflso=
a4.io/blobstash v0.0.0-20181225194431-69866d0dc5f5/go.mod h1:YtIAw8g6uiD0ODIvwJWSmEoKpx3M1cZLIiqrhh9NjSU=

A vendor/a4.io/blobsfile/.build.yml => vendor/a4.io/blobsfile/.build.yml +12 -0
@@ 0,0 1,12 @@
image: ubuntu/latest
sources:
- https://git.sr.ht/~tsileo/blobsfile
tasks:
- setup: |
   mkdir go
   export GOPATH=/home/build/go
   wget https://dl.google.com/go/go1.13.4.linux-amd64.tar.gz
   sudo tar -C /usr/local -xzf go1.13.4.linux-amd64.tar.gz
- test: |
    cd blobsfile
    /usr/local/go/bin/go test -v -bench=. .

D vendor/a4.io/blobsfile/.travis.yml => vendor/a4.io/blobsfile/.travis.yml +0 -8
@@ 1,8 0,0 @@
language: go

go:
  - 1.11

go_import_path: a4.io/blobsfile
script:
 - go test -v -bench=. .

M vendor/a4.io/blobsfile/README.md => vendor/a4.io/blobsfile/README.md +1 -2
@@ 1,8 1,7 @@
# BlobsFile

[![Build Status](https://travis-ci.org/tsileo/blobsfile.svg?branch=master)](https://travis-ci.org/tsileo/blobsfile)
[![builds.sr.ht status](https://builds.sr.ht/~tsileo/blobsfile.svg)](https://builds.sr.ht/~tsileo/blobsfile?)
   [![Godoc Reference](https://godoc.org/a4.io/blobsfile?status.svg)](https://godoc.org/a4.io/blobsfile)
   [![Go Report Card](https://goreportcard.com/badge/a4.io/blobsfile)](https://goreportcard.com/report/a4.io/blobsfile)

*BlobsFile* is an append-only (i.e. no update and no delete) content-addressed *blob store* (using [BLAKE2b](https://blake2.net/) as hash function).


M vendor/a4.io/blobsfile/blobsfile.go => vendor/a4.io/blobsfile/blobsfile.go +19 -12
@@ 193,6 193,8 @@ type Opts struct {
	// When trying to self-heal in case of recovery, some step need to be performed by the user
	AskConfirmationFunc func(msg string) bool

	BlobsFilesSealedFunc func(path string)

	// Not implemented yet, will allow to provide repaired data in case of hard failure
	// RepairBlobFunc func(hash string) ([]byte, error)
}


@@ 231,8 233,9 @@ type BlobsFiles struct {
	lastErr      error
	lastErrMutex sync.Mutex // mutex for guarding the lastErr

	logFunc             func(string)
	askConfirmationFunc func(string) bool
	logFunc              func(string)
	askConfirmationFunc  func(string) bool
	blobsFilesSealedFunc func(string)

	// Reed-solomon encoder for the parity blobs
	rse reedsolomon.Encoder


@@ 272,14 275,15 @@ func New(opts *Opts) (*BlobsFiles, error) {
		return nil, err
	}
	backend := &BlobsFiles{
		directory:        dir,
		compression:      opts.Compression,
		index:            index,
		files:            make(map[int]*os.File),
		maxBlobsFileSize: opts.BlobsFileSize,
		rse:              enc,
		reindexMode:      reindex,
		logFunc:          opts.LogFunc,
		directory:            dir,
		compression:          opts.Compression,
		index:                index,
		files:                make(map[int]*os.File),
		maxBlobsFileSize:     opts.BlobsFileSize,
		blobsFilesSealedFunc: opts.BlobsFilesSealedFunc,
		rse:                  enc,
		reindexMode:          reindex,
		logFunc:              opts.LogFunc,
	}
	if err := backend.load(); err != nil {
		panic(fmt.Errorf("error loading %T: %v", backend, err))


@@ 1187,12 1191,15 @@ func (backend *BlobsFiles) Put(hash string, data []byte) (err error) {
		newBlobsFileNeeded = true

		// This goroutine will write the parity blobs and close the file
		go func(f *os.File, size int) {
		go func(f *os.File, size int, n int) {
			// Write some parity blobs at the end of the blobsfile using Reed-Solomon erasure coding
			if err := backend.writeParityBlobs(f, size); err != nil {
				backend.setLastError(err)
			}
		}(f, int(backend.size))
			if backend.blobsFilesSealedFunc != nil {
				backend.blobsFilesSealedFunc(backend.filename(n))
			}
		}(f, int(backend.size), backend.n)
	}

	if newBlobsFileNeeded {

M vendor/a4.io/blobsfile/go.mod => vendor/a4.io/blobsfile/go.mod +2 -2
@@ 4,8 4,8 @@ require (
	a4.io/blobstash v0.0.0-20181225194431-69866d0dc5f5
	github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db
	github.com/klauspost/reedsolomon v1.8.0
	github.com/onsi/ginkgo v1.7.0 // indirect
	github.com/onsi/gomega v1.4.3 // indirect
	golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9
	golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 // indirect
)

go 1.13

M vendor/modules.txt => vendor/modules.txt +1 -1
@@ 1,4 1,4 @@
# a4.io/blobsfile v0.3.1
# a4.io/blobsfile v0.3.2
a4.io/blobsfile
# a4.io/gluapp v0.0.0-20190530193846-2ad05291e3be
a4.io/gluapp