17 lines
524 B
Go
17 lines
524 B
Go
package encoding
|
|
|
|
// encoding 定义gcl中用到的marshaler
|
|
|
|
type UtilMarshaler interface {
|
|
|
|
// MarshalUtil append the marshaled data to data and return the appended data.
|
|
// The input data coulde be nil. If any error happens, returned []byte is the
|
|
// same as input data. The returned []byte may be re-allocate memory.
|
|
MarshalUtil(data []byte) ([]byte, error)
|
|
}
|
|
|
|
type UtilUnmarshaler interface {
|
|
// UnmarshalUtil unmarshal from data, and return the total consumed bytes.
|
|
UnmarshalUtil(data []byte) (uint64, error)
|
|
}
|