Documentation ¶
Index ¶
- type ActionFn
- type Client
- func (p *Client) AddAction(actionFn ActionFn)
- func (p *Client) Codec() cfacade.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) HandshakeData() *HandshakeData
- 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{}) (*cmsg.Message, error)
- func (p *Client) Send(msgType cmsg.Type, route string, val interface{}) (uint, error)
- func (p *Client) SendRaw(typ cpacket.Type, data []byte) error
- func (p *Client) Serializer() cfacade.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 cfacade.IPacketCodec) Option
- func WithRequestTimeout(requestTimeout time.Duration) Option
- func WithSerializer(serializer cfacade.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() cfacade.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) HandshakeData ¶ added in v1.1.29
func (p *Client) HandshakeData() *HandshakeData
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() cfacade.ISerializer
type HandshakeData ¶
type HandshakeData struct { Code int `json:"code"` Sys HandshakeSys `json:"sys"` }
HandshakeData struct
type HandshakeSys ¶
type HandshakeSys struct { Dict map[string]uint16 `json:"dict"` Heartbeat int `json:"heartbeat"` Serializer string `json:"serializer"` }
HandshakeSys struct
type OnMessageFn ¶ added in v1.1.27
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 cfacade.IPacketCodec) Option
func WithRequestTimeout ¶ added in v1.1.27
func WithSerializer ¶ added in v1.1.27
func WithSerializer(serializer cfacade.ISerializer) Option
Click to show internal directories.
Click to hide internal directories.