From 7faeb7bf51b2b31d937f4448fed4eabac1083de8 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 16 Jun 2017 17:42:37 -0700 Subject: [PATCH] Migrate out of the IPFS repo. License: MIT Signed-off-by: Steven Allen --- LICENSE | 21 +++++++++++++++++++++ Makefile | 15 +++++++++++++++ README.md | 35 +++++++++++++++++++++++++++++++++++ blocks.go | 8 ++++---- blocks_test.go | 6 +++--- 5 files changed, 78 insertions(+), 7 deletions(-) create mode 100644 LICENSE create mode 100644 Makefile create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8001ebe --- /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 0000000..7811c09 --- /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 0000000..0f71920 --- /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 1f6abe6..0ae7b03 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 e984a17..18f0c1f 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) { -- GitLab