ipld-eth-server/vendor/github.com/multiformats/go-multicodec
2019-12-02 13:24:49 -06:00
..
base update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
cbor update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
json update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
mux update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
.travis.yml update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
coding.go update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
header.go update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
LICENSE update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
Makefile update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
multicodec.go update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
package.json update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
README.md update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00

go-multicodec

Travis CI codecov.io GoDoc

multicodec implementation in Go.

Supported codecs

  • /cbor
  • /json
  • /msgio
  • /msgpack
  • /protobuf

Table of Contents

Install

go get github.com/multiformats/go-multicodec

Usage

Look at the Godocs:

import (
  "os"
  "io"

  cbor "github.com/multiformats/go-multicodec/cbor"
  json "github.com/multiformats/go-multicodec/json"
)

func main() {
  dec := cbor.Multicodec().Decoder(os.Stdin)
  enc := json.Multicodec(false).Encoder(os.Stdout)

  for {
    var item interface{}

    if err := dec.Decode(&item); err == io.EOF {
      break
    } else if err != nil {
      panic(err)
    }

    if err := enc.Encode(&item); err != nil {
      panic(err)
    }
  }
}

Maintainers

Captain: @jbenet.

Contribute

Contributions welcome. Please check out the issues.

Check out our contributing document for more information on how we work, and about contributing in general. Please be aware that all interactions related to multiformats are subject to the IPFS Code of Conduct.

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

License

MIT © 2014 Juan Batiz-Benet