Documentation ¶
Index ¶
- type ActionFn
- type Client
- func (p *Client) AddAction(actionFn ActionFn)
- func (p *Client) Codec() cherryFacade.IPacketCodec
- func (p *Client) ConnectToTCP(addr string, tlsConfig ...*tls.Config) error
- func (p *Client) ConnectToWS(addr string, path string, tlsConfig ...*tls.Config) error
- func (p *Client) Disconnect()
- func (p *Client) IsConnected() bool
- func (p *Client) Notify(route string, val interface{}) error
- func (p *Client) On(route string, fn OnMessageFn)
- func (p *Client) Request(route string, val interface{}) (*cherryMessage.Message, error)
- func (p *Client) Send(msgType cherryMessage.Type, route string, data []byte) (uint, error)
- func (p *Client) SendRaw(typ cherryPacket.Type, data []byte) error
- func (p *Client) Serializer() cherryFacade.ISerializer
- type HandshakeData
- type HandshakeSys
- type OnMessageFn
- type Option
- func WithErrorBreak(isBreak bool) Option
- func WithHandshake(handshake string) Option
- func WithHeartbeat(heartBeat int) Option
- func WithPacketCodec(codec cherryFacade.IPacketCodec) Option
- func WithRequestTimeout(requestTimeout time.Duration) Option
- func WithSerializer(serializer cherryFacade.ISerializer) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { TagName string // 客户标识 // contains filtered or unexported fields }
Client struct
func (*Client) Codec ¶ added in v1.1.27
func (p *Client) Codec() cherryFacade.IPacketCodec
func (*Client) ConnectToTCP ¶ added in v1.1.27
func (*Client) ConnectToWS ¶ added in v1.1.27
func (*Client) Disconnect ¶
func (p *Client) Disconnect()
func (*Client) IsConnected ¶ added in v1.1.27
IsConnected return the connection status
func (*Client) On ¶ added in v1.1.27
func (p *Client) On(route string, fn OnMessageFn)
On listener route
func (*Client) Serializer ¶ added in v1.1.27
func (p *Client) Serializer() cherryFacade.ISerializer
type HandshakeData ¶
type HandshakeData struct { Code int `json:"code"` Sys HandshakeSys `json:"sys"` }
HandshakeData struct
type HandshakeSys ¶
HandshakeSys struct
type OnMessageFn ¶ added in v1.1.27
type OnMessageFn func(msg *cherryMessage.Message)
type Option ¶ added in v1.1.27
type Option func(options *options)
func WithErrorBreak ¶ added in v1.1.28
func WithHandshake ¶ added in v1.1.27
func WithHeartbeat ¶ added in v1.1.27
func WithPacketCodec ¶ added in v1.1.27
func WithPacketCodec(codec cherryFacade.IPacketCodec) Option
func WithRequestTimeout ¶ added in v1.1.27
func WithSerializer ¶ added in v1.1.27
func WithSerializer(serializer cherryFacade.ISerializer) Option
Click to show internal directories.
Click to hide internal directories.