2019-11-08 21:45:10 +00:00
|
|
|
package protocol
|
|
|
|
|
|
|
|
// DO NOT EDIT
|
|
|
|
//
|
|
|
|
// This file was generated by ./schema.sh
|
|
|
|
|
|
|
|
|
|
|
|
// EncodeLeader encodes a Leader request.
|
|
|
|
func EncodeLeader(request *Message) {
|
2020-04-23 20:34:44 +00:00
|
|
|
request.reset()
|
2019-11-08 21:45:10 +00:00
|
|
|
request.putUint64(0)
|
|
|
|
|
|
|
|
request.putHeader(RequestLeader)
|
|
|
|
}
|
|
|
|
|
|
|
|
// EncodeClient encodes a Client request.
|
|
|
|
func EncodeClient(request *Message, id uint64) {
|
2020-04-23 20:34:44 +00:00
|
|
|
request.reset()
|
2019-11-08 21:45:10 +00:00
|
|
|
request.putUint64(id)
|
|
|
|
|
|
|
|
request.putHeader(RequestClient)
|
|
|
|
}
|
|
|
|
|
|
|
|
// EncodeHeartbeat encodes a Heartbeat request.
|
|
|
|
func EncodeHeartbeat(request *Message, timestamp uint64) {
|
2020-04-23 20:34:44 +00:00
|
|
|
request.reset()
|
2019-11-08 21:45:10 +00:00
|
|
|
request.putUint64(timestamp)
|
|
|
|
|
|
|
|
request.putHeader(RequestHeartbeat)
|
|
|
|
}
|
|
|
|
|
|
|
|
// EncodeOpen encodes a Open request.
|
|
|
|
func EncodeOpen(request *Message, name string, flags uint64, vfs string) {
|
2020-04-23 20:34:44 +00:00
|
|
|
request.reset()
|
2019-11-08 21:45:10 +00:00
|
|
|
request.putString(name)
|
|
|
|
request.putUint64(flags)
|
|
|
|
request.putString(vfs)
|
|
|
|
|
|
|
|
request.putHeader(RequestOpen)
|
|
|
|
}
|
|
|
|
|
|
|
|
// EncodePrepare encodes a Prepare request.
|
|
|
|
func EncodePrepare(request *Message, db uint64, sql string) {
|
2020-04-23 20:34:44 +00:00
|
|
|
request.reset()
|
2019-11-08 21:45:10 +00:00
|
|
|
request.putUint64(db)
|
|
|
|
request.putString(sql)
|
|
|
|
|
|
|
|
request.putHeader(RequestPrepare)
|
|
|
|
}
|
|
|
|
|
|
|
|
// EncodeExec encodes a Exec request.
|
|
|
|
func EncodeExec(request *Message, db uint32, stmt uint32, values NamedValues) {
|
2020-04-23 20:34:44 +00:00
|
|
|
request.reset()
|
2019-11-08 21:45:10 +00:00
|
|
|
request.putUint32(db)
|
|
|
|
request.putUint32(stmt)
|
|
|
|
request.putNamedValues(values)
|
|
|
|
|
|
|
|
request.putHeader(RequestExec)
|
|
|
|
}
|
|
|
|
|
|
|
|
// EncodeQuery encodes a Query request.
|
|
|
|
func EncodeQuery(request *Message, db uint32, stmt uint32, values NamedValues) {
|
2020-04-23 20:34:44 +00:00
|
|
|
request.reset()
|
2019-11-08 21:45:10 +00:00
|
|
|
request.putUint32(db)
|
|
|
|
request.putUint32(stmt)
|
|
|
|
request.putNamedValues(values)
|
|
|
|
|
|
|
|
request.putHeader(RequestQuery)
|
|
|
|
}
|
|
|
|
|
|
|
|
// EncodeFinalize encodes a Finalize request.
|
|
|
|
func EncodeFinalize(request *Message, db uint32, stmt uint32) {
|
2020-04-23 20:34:44 +00:00
|
|
|
request.reset()
|
2019-11-08 21:45:10 +00:00
|
|
|
request.putUint32(db)
|
|
|
|
request.putUint32(stmt)
|
|
|
|
|
|
|
|
request.putHeader(RequestFinalize)
|
|
|
|
}
|
|
|
|
|
|
|
|
// EncodeExecSQL encodes a ExecSQL request.
|
|
|
|
func EncodeExecSQL(request *Message, db uint64, sql string, values NamedValues) {
|
2020-04-23 20:34:44 +00:00
|
|
|
request.reset()
|
2019-11-08 21:45:10 +00:00
|
|
|
request.putUint64(db)
|
|
|
|
request.putString(sql)
|
|
|
|
request.putNamedValues(values)
|
|
|
|
|
|
|
|
request.putHeader(RequestExecSQL)
|
|
|
|
}
|
|
|
|
|
|
|
|
// EncodeQuerySQL encodes a QuerySQL request.
|
|
|
|
func EncodeQuerySQL(request *Message, db uint64, sql string, values NamedValues) {
|
2020-04-23 20:34:44 +00:00
|
|
|
request.reset()
|
2019-11-08 21:45:10 +00:00
|
|
|
request.putUint64(db)
|
|
|
|
request.putString(sql)
|
|
|
|
request.putNamedValues(values)
|
|
|
|
|
|
|
|
request.putHeader(RequestQuerySQL)
|
|
|
|
}
|
|
|
|
|
|
|
|
// EncodeInterrupt encodes a Interrupt request.
|
|
|
|
func EncodeInterrupt(request *Message, db uint64) {
|
2020-04-23 20:34:44 +00:00
|
|
|
request.reset()
|
2019-11-08 21:45:10 +00:00
|
|
|
request.putUint64(db)
|
|
|
|
|
|
|
|
request.putHeader(RequestInterrupt)
|
|
|
|
}
|
|
|
|
|
2020-01-20 22:33:17 +00:00
|
|
|
// EncodeAdd encodes a Add request.
|
|
|
|
func EncodeAdd(request *Message, id uint64, address string) {
|
2020-04-23 20:34:44 +00:00
|
|
|
request.reset()
|
2019-11-08 21:45:10 +00:00
|
|
|
request.putUint64(id)
|
|
|
|
request.putString(address)
|
|
|
|
|
2020-01-20 22:33:17 +00:00
|
|
|
request.putHeader(RequestAdd)
|
2019-11-08 21:45:10 +00:00
|
|
|
}
|
|
|
|
|
2020-01-20 22:33:17 +00:00
|
|
|
// EncodeAssign encodes a Assign request.
|
|
|
|
func EncodeAssign(request *Message, id uint64, role uint64) {
|
2020-04-23 20:34:44 +00:00
|
|
|
request.reset()
|
2019-11-08 21:45:10 +00:00
|
|
|
request.putUint64(id)
|
2020-01-20 22:33:17 +00:00
|
|
|
request.putUint64(role)
|
2019-11-08 21:45:10 +00:00
|
|
|
|
2020-01-20 22:33:17 +00:00
|
|
|
request.putHeader(RequestAssign)
|
2019-11-08 21:45:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// EncodeRemove encodes a Remove request.
|
|
|
|
func EncodeRemove(request *Message, id uint64) {
|
2020-04-23 20:34:44 +00:00
|
|
|
request.reset()
|
2019-11-08 21:45:10 +00:00
|
|
|
request.putUint64(id)
|
|
|
|
|
|
|
|
request.putHeader(RequestRemove)
|
|
|
|
}
|
|
|
|
|
|
|
|
// EncodeDump encodes a Dump request.
|
|
|
|
func EncodeDump(request *Message, name string) {
|
2020-04-23 20:34:44 +00:00
|
|
|
request.reset()
|
2019-11-08 21:45:10 +00:00
|
|
|
request.putString(name)
|
|
|
|
|
|
|
|
request.putHeader(RequestDump)
|
|
|
|
}
|
|
|
|
|
|
|
|
// EncodeCluster encodes a Cluster request.
|
2020-01-20 22:33:17 +00:00
|
|
|
func EncodeCluster(request *Message, format uint64) {
|
2020-04-23 20:34:44 +00:00
|
|
|
request.reset()
|
2020-01-20 22:33:17 +00:00
|
|
|
request.putUint64(format)
|
2019-11-08 21:45:10 +00:00
|
|
|
|
|
|
|
request.putHeader(RequestCluster)
|
|
|
|
}
|
2020-01-20 22:33:17 +00:00
|
|
|
|
|
|
|
// EncodeTransfer encodes a Transfer request.
|
|
|
|
func EncodeTransfer(request *Message, id uint64) {
|
2020-04-23 20:34:44 +00:00
|
|
|
request.reset()
|
2020-01-20 22:33:17 +00:00
|
|
|
request.putUint64(id)
|
|
|
|
|
|
|
|
request.putHeader(RequestTransfer)
|
|
|
|
}
|