Marshal serializes a type into a byte representation using gogo protobuf serialization rules. It returns the resulting bytes as a slice. The bytes are serialized in a format that is backwards-compatible with the previous version of CRDB so that clusters can run in mixed version mode during upgrade.
()
| 2653 | // |
| 2654 | // bytes, err := protoutil.Marshal(&typ) |
| 2655 | func (t *T) Marshal() (data []byte, err error) { |
| 2656 | // First downgrade to a struct that will be serialized in a backwards- |
| 2657 | // compatible bytes format. |
| 2658 | temp := *t |
| 2659 | if err := temp.downgradeType(); err != nil { |
| 2660 | return nil, err |
| 2661 | } |
| 2662 | return protoutil.Marshal(&temp.InternalType) |
| 2663 | } |
| 2664 | |
| 2665 | // MarshalToSizedBuffer is like Mashal, except that it deserializes to |
| 2666 | // an existing byte slice with exactly enough remaining space for |
no test coverage detected