coredag

package
v0.0.0-...-7d4678c Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

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