MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / UnmarshalBinary

Method UnmarshalBinary

structure/zset.go:1206–1218  ·  view source on GitHub ↗

UnmarshalBinary de-serializes the given byte slice into ZSetValue instance It uses the MessagePack format for de-serialization Returns an error if the decoding of Key, Score, or Value fails.

(data []byte)

Source from the content-addressed store, hash-verified

1204// It uses the MessagePack format for de-serialization
1205// Returns an error if the decoding of Key, Score, or Value fails.
1206func (p *ZSetValue) UnmarshalBinary(data []byte) (err error) {
1207 dec := encoding.NewMessagePackDecoder(data)
1208 if err = dec.Decode(&p.member); err != nil {
1209 return
1210 }
1211 if err = dec.Decode(&p.score); err != nil {
1212 return err
1213 }
1214 if err = dec.Decode(&p.value); err != nil {
1215 return
1216 }
1217 return
1218}
1219
1220// MarshalBinary uses MessagePack as the encoding format to serialize
1221// the ZSetValue object into a byte array.

Callers

nothing calls this directly

Calls 2

NewMessagePackDecoderFunction · 0.92
DecodeMethod · 0.45

Tested by

no test coverage detected