Documentation ¶
Index ¶
- Variables
- type Marsha
- func (m *Marsha) MarshalPrimitive(p interface{}) ([]byte, error)
- func (m *Marsha) MarshalStruct(p marsha.StructPtr) ([]byte, error)
- func (m *Marsha) MarshalStructSlice(p marsha.StructSlicePtr) (bin []byte, err error)
- func (m *Marsha) NewDecoder(r io.Reader) marsha.Decoder
- func (m *Marsha) NewEncoder(w io.Writer) marsha.Encoder
- func (m *Marsha) Register(i interface{})
- func (m *Marsha) UnmarshalPrimitive(bin []byte, p interface{}) (int, error)
- func (m *Marsha) UnmarshalStruct(bin []byte, p marsha.StructPtr) (int, error)
- func (m *Marsha) UnmarshalStructSlice(bin []byte, p marsha.StructSlicePtr) (int, error)
- type StructPtr
- type StructSlicePtr
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Marsha ¶ added in v0.0.2
type Marsha struct {
// contains filtered or unexported fields
}
Marsha is a fast Marsha implementation for CBOR backed by `go-ipld-cbor` package and marshaling/unmarshaling code generated by github.com/daotl/cbor-gen package.
func (*Marsha) MarshalPrimitive ¶ added in v0.0.2
func (*Marsha) MarshalStruct ¶ added in v0.0.2
func (*Marsha) MarshalStructSlice ¶ added in v0.0.2
func (*Marsha) NewDecoder ¶ added in v0.0.2
func (*Marsha) NewEncoder ¶ added in v0.0.2
func (*Marsha) Register ¶ added in v0.0.2
func (m *Marsha) Register(i interface{})
Register a Struct type by passing empty a Struct.
func (*Marsha) UnmarshalPrimitive ¶ added in v0.0.2
This implementation does not support returning the count of bytes read.
func (*Marsha) UnmarshalStruct ¶ added in v0.0.2
type StructPtr ¶
type StructPtr interface { marsha.StructPtr // MarshalCBOR should be generated by `github.com/daotl/cbor-gen` package. // This implements `github.com/daotl/cbor-gen.CBORMarshaler` MarshalCBOR(w io.Writer) (int, error) // UnmarshalCBOR should be generated by `github.com/daotl/cbor-gen` package. // This implements `github.com/daotl/cbor-gen.CBORUnmarshaler` UnmarshalCBOR(r io.Reader) (int, error) }
StructPtr implements `github.com/ipfs-ipld-cbor/encoding.cborMarshaler`
type StructSlicePtr ¶
type StructSlicePtr interface { marsha.StructSlicePtr // NewStruct should return an empty marsha.Struct. NewStructPtr() marsha.StructPtr // Append should append `p.Val()` to the `StructSlice` this `StructSlicePtr` points to. Append(p StructPtr) }
Click to show internal directories.
Click to hide internal directories.