MCPcopy Create free account
hub / github.com/actiontech/dtle / Decode

Function Decode

driver/common/common.go:111–131  ·  view source on GitHub ↗
(data []byte, out GencodeType)

Source from the content-addressed store, hash-verified

109}
110
111func Decode(data []byte, out GencodeType) (err error) {
112 r, err := compress.NewReader(bytes.NewReader(data))
113 if err != nil {
114 return err
115 }
116 msg, err := ioutil.ReadAll(r)
117 _ = r.Close()
118 if err != nil {
119 return err
120 }
121
122 n, err := out.Unmarshal(msg)
123 if err != nil {
124 return err
125 }
126 if n != uint64(len(msg)) {
127 return fmt.Errorf("BinlogEntries.Unmarshal: not all consumed. data: %v, consumed: %v",
128 len(msg), n)
129 }
130 return nil
131}
132func DecodeMaybeTable(data []byte) (*Table, error) {
133 if len(data) > 0 {
134 r := &Table{}

Callers 4

doFullCopyMethod · 0.92
subscribeNatsMethod · 0.92
heterogeneousReplayMethod · 0.92
initiateStreamingMethod · 0.92

Calls 2

UnmarshalMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected