Documentation ¶
Overview ¶
Copyright (c) 2023, donnie <donnie4w@gmail.com> All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
github.com/donnie4w/tldb
Copyright (c) 2023, donnie <donnie4w@gmail.com> All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
github.com/donnie4w/tldb
Copyright (c) 2023, donnie <donnie4w@gmail.com> All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
github.com/donnie4w/tldb
Index ¶
- Constants
- Variables
- func AddConn(ws *tlnet.Websocket, cliId int64) (err error)
- func Close(wsId int64)
- func DelAckId(wsid, ackid int64)
- func IsRecvAckOn(id int64) (_r bool)
- func JEncode(mb *JMqBean) (bs []byte)
- func MQDecode[T thrift.TStruct](bs []byte, ts T) (_r T, err error)
- func MQEncode(ts thrift.TStruct) (_r []byte)
- func SetJsonOn(id int64, topic string, on bool)
- func SetMergeOn(id int64, size int8)
- func SetRecvAck(id int64, sec int8)
- func SetZlib(id int64, on bool)
- type JMqBean
- type MqEg
- type WsSock
- func (this *WsSock) AckTimer()
- func (this *WsSock) DelAckId(id int64)
- func (this *WsSock) MergeSend(buf *bytes.Buffer)
- func (this *WsSock) Send(buf *bytes.Buffer) (err error)
- func (this *WsSock) SendWithAck(buf *bytes.Buffer) (err error)
- func (this *WsSock) SetJsonOn(topic string, on bool)
- func (this *WsSock) SetMergeOn(size int8)
- func (this *WsSock) SetRecvAckOn(sec int8)
- func (this *WsSock) SetZlib(zlib bool)
Constants ¶
View Source
const ( MQ_AUTH byte = 1 MQ_PUBBYTE byte = 2 MQ_PUBJSON byte = 3 MQ_SUB byte = 4 MQ_PULLBYTE byte = 5 MQ_PULLJSON byte = 6 MQ_PING byte = 7 MQ_ERROR byte = 8 MQ_PUBMEM byte = 9 MQ_RECVACK byte = 10 MQ_MERGE byte = 11 MQ_SUBCANCEL byte = 12 MQ_CURRENTID byte = 13 MQ_ZLIB byte = 14 MQ_LOCK byte = 15 MQ_ACK byte = 0 MQ_ERROR_PUBBYTE int64 = 1201 // 发布pubByte错误 MQ_ERROR_PUBJSON int64 = 1202 // 发布pubJson错误 MQ_ERROR_PULLBYTE int64 = 1203 // 发布pullByte错误 MQ_ERROR_PULLJSON int64 = 1204 // 发布pullJson错误 MQ_ERROR_PUBMEM int64 = 1205 // 发布pubMem错误 MQ_ERROR_CURRENTID int64 = 1206 // 发布CURRENTID错误 MQ_ERROR_NOPASS int64 = 1301 // 验证不通过 )
Variables ¶
View Source
var CliWare = NewMap[int64, *WsSock]()
View Source
var MqWare = NewMqEngine()
View Source
var WsWare = NewMapL[int64, *WsSock]()
Functions ¶
func IsRecvAckOn ¶
func SetMergeOn ¶
func SetRecvAck ¶
Types ¶
type MqEg ¶
type MqEg interface { AddConn(topic string, ws *tlnet.Websocket) DelConn(id int64) SubCount(topic string) (_r int64) DelTopic(topic string) DelTopicWithID(topic string, id int64) ClusPub(mqType int8, bs []byte) (err error) PubByte(mb *MqBean, wsId int64, self bool) (err error) PubJson(mb *JMqBean, wsId int64, self bool) (err error) PubMem(mb *JMqBean, wsId int64, self bool) PullByte(mb *MqBean, id int64) (err error) PullJson(mb *JMqBean, id int64) (err error) PullId(id int64) (err error) Ping(buf *bytes.Buffer, id int64) Ack(buf *bytes.Buffer, id int64) }
type WsSock ¶
type WsSock struct {
// contains filtered or unexported fields
}
func (*WsSock) SetMergeOn ¶
func (*WsSock) SetRecvAckOn ¶
Click to show internal directories.
Click to hide internal directories.