Versions in this module Expand all Collapse all v1 v1.0.3 Sep 27, 2020 Changes in this version + const MessageTypeKeep + const MessageTypeReply type Client + func (c *Client) NextRequestId(cb func(*Message)) uint32 + func (c *Client) OnReply(msg *Message) + type Message struct + Payload []byte + Tag uint32 + Type MessageType + func (m *Message) Reply(tag uint32, payload []byte) type Server + ReadTimeout time.Duration + WriteTimeout time.Duration + func (s *Server) NextRequestId(cb func(*Message)) uint32 v1.0.2 Sep 25, 2020 v1.0.1 Sep 22, 2020 Changes in this version type Client + ReadTimeout time.Duration + WriteTimeout time.Duration v1.0.0 Sep 21, 2020 Changes in this version + const MessageTypeData + const MessageTypePing + const MessageTypePong + var ErrorConnectIdInvalid = errors.New("connect id invalid") + var ErrorConnectionInvalid = errors.New("connection invalid") + var ErrorMessageFormatInvalid = errors.New("message format invalid") + var File_message_proto protoreflect.FileDescriptor + type AcceptClient struct + type Client struct + OnClose func() + OnConnected func() + OnData func(tag uint32, payload []byte) + func NewClient() (*Client, error) + func (c *Client) Close() + func (c *Client) DialAndServe(address string, password []byte, salt []byte) error + func (c *Client) Reconnect(second time.Duration) + func (c *Client) Send(tag uint32, data []byte) (n int, err error) + type Event struct + ClientId uint64 + Request *Request + RequestId uint32 + type MessageType uint8 + type Request struct + Body []byte + Id int32 + Tag int32 + func (*Request) Descriptor() ([]byte, []int) + func (*Request) ProtoMessage() + func (x *Request) GetBody() []byte + func (x *Request) GetId() int32 + func (x *Request) GetTag() int32 + func (x *Request) ProtoReflect() protoreflect.Message + func (x *Request) Reset() + func (x *Request) String() string + type Response struct + Body []byte + Id int32 + Status int32 + Tag int32 + Type int32 + func (*Response) Descriptor() ([]byte, []int) + func (*Response) ProtoMessage() + func (x *Response) GetBody() []byte + func (x *Response) GetId() int32 + func (x *Response) GetStatus() int32 + func (x *Response) GetTag() int32 + func (x *Response) GetType() int32 + func (x *Response) ProtoReflect() protoreflect.Message + func (x *Response) Reset() + func (x *Response) String() string + type Server struct + OnClose func(id uint64) + OnData func(id uint64, tag uint32, payload []byte) + OnNew func(id uint64) + func NewServer() (*Server, error) + func (s *Server) Send(id uint64, tag uint32, data []byte) (n int, err error) + func (s *Server) Serve(address string, password []byte, salt []byte) error