MCPcopy
hub / github.com/cubefs/cubefs / MarshalData

Method MarshalData

client/blockcache/bcache/packet.go:338–345  ·  view source on GitHub ↗
(v interface{})

Source from the content-addressed store, hash-verified

336}
337
338func (p *BlockCachePacket) MarshalData(v interface{}) error {
339 data, err := json.Marshal(v)
340 if err == nil {
341 p.Data = data
342 p.Size = uint32(len(p.Data))
343 }
344 return err
345}
346
347func (p *BlockCachePacket) UnmarshalData(v interface{}) error {
348 return json.Unmarshal(p.Data, v)

Callers

nothing calls this directly

Calls 1

MarshalMethod · 0.65

Tested by

no test coverage detected