ipld-eth-server/vendor/github.com/multiformats/go-multicodec/README.md

2.6 KiB

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