本文整理匯總了Golang中github.com/housinganywhere/pg/internal/pool.Buffer.WriteByte方法的典型用法代碼示例。如果您正苦於以下問題:Golang Buffer.WriteByte方法的具體用法?Golang Buffer.WriteByte怎麽用?Golang Buffer.WriteByte使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/housinganywhere/pg/internal/pool.Buffer
的用法示例。
在下文中一共展示了Buffer.WriteByte方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: writeQueryMsg
func writeQueryMsg(buf *pool.Buffer, query interface{}, params ...interface{}) error {
buf.StartMessage(queryMsg)
bytes, err := orm.AppendQuery(buf.Bytes, query, params...)
if err != nil {
buf.Reset()
return err
}
buf.Bytes = bytes
buf.WriteByte(0x0)
buf.FinishMessage()
return nil
}
示例2: writeParseDescribeSyncMsg
func writeParseDescribeSyncMsg(buf *pool.Buffer, name, q string) {
buf.StartMessage(parseMsg)
buf.WriteString(name)
buf.WriteString(q)
buf.WriteInt16(0)
buf.FinishMessage()
buf.StartMessage(describeMsg)
buf.WriteByte('S')
buf.WriteString(name)
buf.FinishMessage()
buf.StartMessage(syncMsg)
buf.FinishMessage()
}