Versions in this module Expand all Collapse all v0 v0.2.0 Aug 20, 2021 Changes in this version + type MessagePack interface + FromBinary func(fh utp.FixedHeader, data []byte) + Info func() utp.Info + ToBinary func() (bytes.Buffer, error) + Type func() utp.MessageType v0.1.1 Jul 8, 2021 Changes in this version + const MaxMessageSize + var ErrServerClosed = errors.New("Server closed") + func Encode(adp ProtoAdapter, msg LineProtocol) (bytes.Buffer, error) + func StreamConn(stream grpc.Stream) *common.Conn + type Conn struct + Decode common.Decoder + Encode common.Encoder + InMsg proto.Message + OutMsg proto.Message + Stream *websocket.Conn + WriteLock *sync.Mutex + func WebSocketConn(stream *websocket.Conn) *Conn + func (c *Conn) Close() error + func (c *Conn) LocalAddr() net.Addr + func (c *Conn) Read(p []byte) (n int, err error) + func (c *Conn) RemoteAddr() net.Addr + func (c *Conn) SetDeadline(time.Time) error + func (c *Conn) SetReadDeadline(time.Time) error + func (c *Conn) SetWriteDeadline(time.Time) error + func (c *Conn) Write(p []byte) (int, error) + type Connect struct + BatchByteThreshold int32 + BatchCountThreshold int32 + BatchDuration int32 + CleanSessFlag bool + ClientID []byte + InsecureFlag bool + KeepAlive uint16 + Password []byte + SessKey uint32 + Username string + Version uint8 + func (c *Connect) Info() Info + func (c *Connect) Type() MessageType + type ConnectAcknowledge struct + ConnID uint32 + Epoch uint32 + ReturnCode uint8 + type ControlMessage struct + FlowControl FlowControl + Message LineProtocol + MessageID uint16 + MessageType MessageType + func (c *ControlMessage) Info() Info + func (c *ControlMessage) Type() MessageType + type DeliveryMode uint8 + const BATCH + const EXPRESS + const RELIABLE + type Disconnect struct + func (d *Disconnect) Info() Info + func (d *Disconnect) Type() MessageType + type FixedHeader struct + FlowControl uint8 + MessageType uint8 + MesssageLength int + type FlowControl uint8 + const ACKNOWLEDGE + const COMPLETE + const NONE + const NOTIFY + const RECEIPT + const RECEIVE + func (t FlowControl) Value() uint8 + type GrpcServer server + func NewGrpcServer(opts ...Options) *GrpcServer + func (s *GrpcServer) Serve(list net.Listener) error + func (s *GrpcServer) Stream(stream pbx.Unitdb_StreamServer) error + type Handler func(c net.Conn) + type HttpServer server + func NewHttpServer(opts ...Options) *HttpServer + func (s *HttpServer) HandleFunc(w http.ResponseWriter, r *http.Request) + func (s *HttpServer) Serve(list net.Listener) error + type Info struct + DeliveryMode uint8 + MessageID uint16 + type LineProtocol interface + Info func() Info + Type func() MessageType + func Read(adp ProtoAdapter, r io.Reader) (LineProtocol, error) + type MessageType uint8 + const CONNECT + const DISCONNECT + const FLOWCONTROL + const PINGREQ + const PUBLISH + const SUBSCRIBE + const UNSUBSCRIBE + func (t MessageType) Value() uint8 + type Options interface + func WithDefaultOptions() Options + func WithTLSConfig(t *tls.Config) Options + type Pingreq struct + func (p *Pingreq) Info() Info + func (p *Pingreq) Type() MessageType + type Proto int + const UNITQL + const UTP + type ProtoAdapter interface + Encode func(msg LineProtocol) (bytes.Buffer, error) + Read func(r io.Reader) (LineProtocol, error) + type Publish struct + DeliveryMode uint8 + IsForwarded bool + MessageID uint16 + Messages []*PublishMessage + func (p *Publish) Info() Info + func (p *Publish) Type() MessageType + type PublishMessage struct + Payload []byte + Topic []byte + Ttl string + type Server interface + Serve func(net.Listener) error + type Subscribe struct + IsForwarded bool + MessageID uint16 + Subscriptions []*Subscription + func (s *Subscribe) Info() Info + func (s *Subscribe) Type() MessageType + type Subscription struct + Delay int32 + DeliveryMode uint8 + Last string + Topic []byte + type TcpServer server + func NewTcpServer(opts ...Options) *TcpServer + func (s *TcpServer) Serve(list net.Listener) error + type Unsubscribe struct + IsForwarded bool + MessageID uint16 + Subscriptions []*Subscription + func (u *Unsubscribe) Info() Info + func (u *Unsubscribe) Type() MessageType