Ejemplo n.º 1
0
func (c *Client) sendClientInfo(w *rw.Writer) {
	if c.curProtoVers >= ProtoVersion7 {
		w.WriteStrings(driverName, driverVersion) // driver info
		w.WriteShort(int16(c.curProtoVers))       // protocol version
		w.WriteNull()                             // client id (needed only for cluster config)
	}
	if c.curProtoVers > ProtoVersion21 {
		w.WriteString(c.recordFormat.String())
	} else {
		panic("CSV serializer is not supported")
	}
	if c.curProtoVers > ProtoVersion26 {
		w.WriteBool(false) // use token (true) or session (false)
	}
}