NOTE: Multicodec is not deprecated, just this library.
This library has been deprecated to reduce confusion concerning the multicodec project. It is not an implementation of multicodec as it exists today (as described in the project's README). Instead, it's closer to the multistream protocol but we already have an actively used go-multistream
repository (for multistream-select).
This library will not be maintained.
multicodec implementation in Go.
/cbor
/json
/msgio
/msgpack
/protobuf
go get github.com/multiformats/go-multicodec
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)
}
}
}
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.
MIT © 2014 Juan Batiz-Benet