Commit 18d1705b authored by Eric Myhre's avatar Eric Myhre

Initial commit go-ipld-prime

We'll see if this is a good idea or not.  It's either a newer, cleaner,
lessons-learned set of libraries for using IPLD; or, it'll turn into a
"lesson-learned" itself and we'll fold the learnings back into the
existing libraries.  Time will tell!
parents
src/github.com/ipld/go-ipld-prime
\ No newline at end of file
../../../../
\ No newline at end of file
The MIT License (MIT)
Copyright (c) 2018 Eric Myhre
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.
go-ipld-prime
=============
`go-ipld-prime` is an implementation of the IPLD spec interfaces, a default "native" implementation of IPLD based on CBOR, and tooling for basic operations on IPLD objects.
API
---
- `github.com/ipld/go-ipld-prime` -- imported as just `ipld` -- contains interfaces for IPLD objects. You can implement these interfaces too. This package also provides a concrete implementation of merklepaths, and contains useful traversal functions.
- `github.com/ipld/go-ipld-prime/impl/cbor` -- imported as `ipldcbor` -- implements the IPLD interfaces backed with CBOR serialization. There are lots of handy methods for you to convert other Go types to and from these nodes.
- `github.com/ipld/go-ipld-prime/cmd/ipld` -- provides a standalone command-line tool for useful operations, such as processing objects and producing CIDs (hashes) for their canonicalized IPLD forms.
### distinctions from go-ipld-interface&go-ipld-cbor
This library is a clean take on the IPLD interfaces and addresses several design decisions very differently than existing libraries:
- The Node interfaces are minimal;
- Many features known to be legacy are dropped;
- The Link implementations are purely CIDs;
- The Path implementations are provided in the same box;
- The CBOR implementation is provided in the same box;
- And several odd dependencies on blockstore and other interfaces from the rest of the IPFS ecosystem are removed.
Most of these changes are on the roadmap for the existing IPLD projects as well, but a clean break v2 simply seemed like a clearer project-management path to getting to the end.
Both the existing IPLD libraries and go-ipld-prime can co-exist on the same import path, and refer to the same kinds of serial data.
Projects wishing to migrate can do so smoothly and at their leisure.
package ipldcbor
import (
"github.com/ipld/go-ipld-prime"
)
var _ ipld.Node = &Node{}
type Node struct {
}
package ipld
type Node interface {
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment