coredag

package module
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2020 License: MIT Imports: 10 Imported by: 0

README

coredag

Extracted go-ipfs/core/coredag logic with added tests. Intended to be used as a customizable/re-usable library for making dag things.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultInputEncParsers = InputEncParsers{
	"json":     defaultJSONParsers,
	"cbor":     defaultCborParsers,
	"raw":      defaultRawParsers,
	"protobuf": defaultProtobufParsers,
}

DefaultInputEncParsers is InputEncParser that is used everywhere

Functions

func ParseInputs

func ParseInputs(ienc, format string, r io.Reader, mhType uint64, mhLen int) ([]ipld.Node, error)

ParseInputs uses DefaultInputEncParsers to parse io.Reader described by input encoding and format to an instance of ipld Node

Types

type DagParser

type DagParser func(r io.Reader, mhType uint64, mhLen int) ([]ipld.Node, error)

DagParser is function used for parsing stream into Node

type FormatParsers

type FormatParsers map[string]DagParser

FormatParsers is used for mapping format descriptors to DagParsers

type InputEncParsers

type InputEncParsers map[string]FormatParsers

InputEncParsers is used for mapping input encodings to FormatParsers

func (InputEncParsers) ParseInputs

func (iep InputEncParsers) ParseInputs(ienc, format string, r io.Reader, mhType uint64, mhLen int) ([]ipld.Node, error)

ParseInputs parses io.Reader described by input encoding and format to an instance of ipld Node

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL