diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..8001ebee6a706aa225af494920a1e1c593143c2c --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017 Juan Batiz-Benet + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..7811c099eaec382e6d23793aebfaf129be662d3e --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +gx: + go get github.com/whyrusleeping/gx + go get github.com/whyrusleeping/gx-go + +covertools: + go get github.com/mattn/goveralls + go get golang.org/x/tools/cmd/cover + +deps: gx covertools + gx --verbose install --global + gx-go rewrite + +publish: + gx-go rewrite --undo + diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0f71920a6febe1882e9acfeb3f41bca58ba29fa9 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +go-block-format +================== + +[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) +[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/) +[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) +[![Coverage Status](https://coveralls.io/repos/github/ipfs/go-block-node/badge.svg?branch=master)](https://coveralls.io/github/ipfs/go-block-node?branch=master) +[![Travis CI](https://travis-ci.org/ipfs/go-block-node.svg?branch=master)](https://travis-ci.org/ipfs/go-block-node) + +> go-block-format is a set of interfaces that a type needs to implement in order to be a CID addressable block of data. + + +## Table of Contents + +- [Install](#install) +- [Usage](#usage) +- [API](#api) +- [Contribute](#contribute) +- [License](#license) + +## Install + +```sh +make install +``` + +## Contribute + +PRs are welcome! + +Small note: If editing the Readme, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification. + +## License + +MIT © Juan Batiz-Benet diff --git a/blocks.go b/blocks.go index 1f6abe655da28534fc4ff6d5fcded4ce5a943546..0ae7b03d4a92ebcef62d9b637cf5eab1ae55cff2 100644 --- a/blocks.go +++ b/blocks.go @@ -1,4 +1,4 @@ -// Package blocks contains the lowest level of IPFS data structures. +// Package blocks contains the lowest level of IPLD data structures. // A block is raw data accompanied by a CID. The CID contains the multihash // corresponding to the block. package blocks @@ -7,9 +7,9 @@ import ( "errors" "fmt" - mh "gx/ipfs/QmVGtdTZdTFaLsaj2RwdVG8jcjNNcp1DE914DKZ2kHmXHw/go-multihash" - u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "github.com/ipfs/go-cid" + u "github.com/ipfs/go-ipfs-util" + mh "github.com/multiformats/go-multihash" ) // ErrWrongHash is returned when the Cid of a block is not the expected diff --git a/blocks_test.go b/blocks_test.go index e984a177258b674d233f793cec1d9cecfd8ddb28..18f0c1f38c0bfa32171dfc35dcc83388b53544fb 100644 --- a/blocks_test.go +++ b/blocks_test.go @@ -4,9 +4,9 @@ import ( "bytes" "testing" - mh "gx/ipfs/QmVGtdTZdTFaLsaj2RwdVG8jcjNNcp1DE914DKZ2kHmXHw/go-multihash" - u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util" - cid "gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid" + cid "github.com/ipfs/go-cid" + u "github.com/ipfs/go-ipfs-util" + mh "github.com/multiformats/go-multihash" ) func TestBlocksBasic(t *testing.T) {