Back to godoc.org
github.com/ipfs/go-ipfs/core/coredag

package coredag

v0.5.1
Latest Go to latest
Published: May 9, 2020 | Licenses: Apache-2.0, MIT, Apache-2.0, MIT | Module: github.com/ipfs/go-ipfs

Index

Variables

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

DefaultInputEncParsers is InputEncParser that is used everywhere

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

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

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier