coredag

package
v0.4.18 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2018 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultInputEncParsers = InputEncParsers{
	"json":     defaultJSONParsers,
	"raw":      defaultRawParsers,
	"cbor":     defaultCborParsers,
	"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) AddParser

func (iep InputEncParsers) AddParser(ienc, format string, f DagParser)

AddParser adds DagParser under give input encoding and format

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

Jump to

Keyboard shortcuts

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