Categorygithub.com/daotl/go-marsha
modulepackage
0.3.0
Repository: https://github.com/daotl/go-marsha.git
Documentation: pkg.go.dev

# README

go-marsha

Go Reference

Marsha provides a standard data marshaling and unmarshaling interface which can be implemented by different encodings and implementations such as CBOR and Protocol Buffers.

Current available implementations

cborgen

A fast Marsha implementation for CBOR backed bygo-ipld-cbor package and github.com/daotl/cbor-gen package.

To use this implementation, marshaling/unmarshaling code generated by cbor-gen must exist.

Note that some types are not supported by cbor-gen yet such as float types,pointers to integers, some slice and map types, etc.

It additionally supports Cid type from github.com/ipfs/go-cid package.

cbor_refmt

A Marsha implementation for CBOR backed bygo-ipld-cbor and refmt packages.

Optionally, if marshaling/unmarshaling code generated by github.com/daotl/cbor-gen package is available, it will be used for performance improvement.

Note that some types are not supported by cbor-gen yet such as float types pointers to integers, some slice and map types, etc.

It additionally supports Cid type from github.com/ipfs/go-cid package.

protobuf

A Marsha implementation for Protocol Buffers backed by *.pb.go files pre-generated by protoc. Only MarshalStruct and UnmarshalStruct are supported by this implementation because of the limitation of Protocol Buffers.

License

MIT © DAOT Labs.

# Packages

Package cbor_refmt provides a `Marsha` implementation for CBOR backed by go-ipld-cbor and refmt packages.
No description provided by the author
Package protobuf provides a Marsha implementation for Protocol Buffers backed by `*.pb.go` files pre-generated by `protoc`.
No description provided by the author

# Variables

No description provided by the author

# Interfaces

A Decoder manages the receipt of type and data information read from the remote side of a connection.
An Encoder manages the transmission of type and data information to the other side of a connection.
Marsha is a standard data marshaling and unmarshaling interface which can be implemented by different encodings and implementations such as CBOR and Protocol Buffers.
Struct should be implemented by structs you want to marshal/unmarshal.
StructPtr should be implemented by pointers to structs you want to marshal/unmarshal.
StructSlicePtr should be implemented by pointers to struct slices you want to marshal/unmarshal.