本文整理匯總了Golang中github.com/apoydence/talaria/messages.Client.GetMessageId方法的典型用法代碼示例。如果您正苦於以下問題:Golang Client.GetMessageId方法的具體用法?Golang Client.GetMessageId怎麽用?Golang Client.GetMessageId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/apoydence/talaria/messages.Client
的用法示例。
在下文中一共展示了Client.GetMessageId方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: writeReadData
func (b *Broker) writeReadData(data []byte, message *messages.Client, conn *websocket.Conn) {
msgType := messages.Server_ReadData
server := &messages.Server{
MessageType: &msgType,
MessageId: proto.Uint64(message.GetMessageId()),
ReadData: &messages.ReadData{
Data: data,
},
}
b.writeMessage(server, conn)
}
示例2: writeFileOffset
func (b *Broker) writeFileOffset(offset int64, message *messages.Client, conn *websocket.Conn) {
msgType := messages.Server_FileOffset
server := &messages.Server{
MessageType: &msgType,
MessageId: proto.Uint64(message.GetMessageId()),
FileOffset: &messages.FileOffset{
Offset: proto.Int64(offset),
},
}
b.writeMessage(server, conn)
}
示例3: writeError
func (b *Broker) writeError(errStr string, message *messages.Client, conn *websocket.Conn) {
msgType := messages.Server_Error
server := &messages.Server{
MessageType: &msgType,
MessageId: proto.Uint64(message.GetMessageId()),
Error: &messages.Error{
Message: proto.String(errStr),
},
}
b.writeMessage(server, conn)
}
示例4: writeFileLocation
func (b *Broker) writeFileLocation(fetchFileErr *FetchFileError, message *messages.Client, conn *websocket.Conn) {
var uri string
if fetchFileErr != nil {
uri = fetchFileErr.Uri
}
msgType := messages.Server_FileLocation
server := &messages.Server{
MessageType: &msgType,
MessageId: proto.Uint64(message.GetMessageId()),
FileLocation: &messages.FileLocation{
Local: proto.Bool(uri == ""),
Uri: proto.String(uri),
},
}
b.writeMessage(server, conn)
}