Categorygithub.com/ipfs/go-ipld-cbor
modulepackage
0.2.0
Repository: https://github.com/ipfs/go-ipld-cbor.git
Documentation: pkg.go.dev

# README

go-ipld-cbor

Coverage Status Travis CI

An implementation of a cbor encoded merkledag object.

Status

This library has alternatives available: For new projects, prefer using the cbor codec included with go-ipld-prime.

This library is in standby mode. It works, but we recommend migrating to alternatives if possible. New features are unlikely to be added here.

Lead Maintainer

Eric Myhre

Table of Contents

Install

make install

Usage

Note: This package isn't the easiest to use.

// Make an object
obj := map[interface{}]interface{}{
	"foo": "bar",
	"baz": &Link{
		Target: myCid,
	},
}

// Parse it into an ipldcbor node
nd, err := WrapMap(obj)

fmt.Println(nd.Links())

Contribute

PRs are welcome!

Small note: If editing the Readme, please conform to the standard-readme specification.

License

MIT © Jeromy Johnson

# Packages

No description provided by the author

# Functions

Decode decodes a CBOR object into an IPLD Node.
DecodeBlock decodes a CBOR encoded Block into an IPLD Node.
DecodeInto decodes a serialized IPLD cbor object into the given object.
DecodeReader reads from the given reader and decodes a serialized IPLD cbor object into the given object.
DumpObject marshals any object into its CBOR serialized byte representation Deprecated: use Encode instead.
Encode marshals any object into its CBOR serialized byte representation.
EncodeWriter marshals into the writer any object as its CBOR serialized byte representation.
FromJSON converts incoming JSON into a Node.
HumanReadable returns a string representation of a CBOR blob.
NewCborStore returns an IpldStore implementation backed by the provided IpldBlockstore.
No description provided by the author
No description provided by the author
RegisterCborType allows to register a custom cbor type.
WrapObject converts an arbitrary object into a Node.

# Constants

CBORTagLink is the integer used to represent tags in CBOR.
No description provided by the author

# Variables

BigIntAtlasEntry gives a reasonable default encoding for big.Int.
CborAtlas is the refmt.Atlas used by the CBOR IPLD decoder/encoder.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ErrNoSuchLink is returned when no link with the given name was found.

# Structs

BasicIpldStore wraps and IpldBlockstore and implements the IpldStore interface.
Node represents an IPLD node.
No description provided by the author

# Interfaces

IpldBlockstore defines a subset of the go-ipfs-blockstore Blockstore interface providing methods for storing and retrieving block-centered data.
IpldBlockstoreViewer is a trait that enables zero-copy access to blocks in a blockstore.
IpldStore wraps a Blockstore and provides an interface for storing and retrieving CBOR encoded data.