mirror of
https://github.com/hanzo-ds/native.git
synced 2026-10-30 20:00:34 +00:00
Module path, package names, and identifiers de-branded to native/proto/compress/ pool/tracing. Server wire-protocol strings preserved. Vendored codec surface used by hanzo-ds/go (proto + compress).
25 lines
446 B
Go
25 lines
446 B
Go
package proto
|
|
|
|
import "github.com/go-faster/errors"
|
|
|
|
type ClientData struct {
|
|
TableName string
|
|
}
|
|
|
|
func (c ClientData) EncodeAware(b *Buffer, version int) {
|
|
if FeatureTempTables.In(version) {
|
|
b.PutString(c.TableName)
|
|
}
|
|
}
|
|
|
|
func (c *ClientData) DecodeAware(r *Reader, version int) error {
|
|
if FeatureTempTables.In(version) {
|
|
v, err := r.Str()
|
|
if err != nil {
|
|
return errors.Wrap(err, "temp tables")
|
|
}
|
|
c.TableName = v
|
|
}
|
|
return nil
|
|
}
|