client

package
v0.0.31 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Packet added in v0.0.31

type Packet struct {
	// contains filtered or unexported fields
}

type UDSConnectionClosedEventHandle added in v0.0.31

type UDSConnectionClosedEventHandle func(conn *UnixDomainSocket, err any)

type UDSConnectionOpenedEventHandle added in v0.0.31

type UDSConnectionOpenedEventHandle func(conn *UnixDomainSocket)

type UDSConnectionReceivePacketEventHandle added in v0.0.31

type UDSConnectionReceivePacketEventHandle func(conn *UnixDomainSocket, packet server.Packet)

type UnixDomainSocket added in v0.0.31

type UnixDomainSocket struct {
	// contains filtered or unexported fields
}

UnixDomainSocket unix domain socket 客户端

func NewUnixDomainSocket added in v0.0.31

func NewUnixDomainSocket(addr string) *UnixDomainSocket

NewUnixDomainSocket 创建 unix domain socket 客户端

func (*UnixDomainSocket) Close added in v0.0.31

func (slf *UnixDomainSocket) Close()

Close 关闭

func (*UnixDomainSocket) GetData added in v0.0.31

func (slf *UnixDomainSocket) GetData(key string) any

GetData 获取数据

func (*UnixDomainSocket) IsConnected added in v0.0.31

func (slf *UnixDomainSocket) IsConnected() bool

IsConnected 是否已连接

func (UnixDomainSocket) OnUDSConnectionClosedEvent added in v0.0.31

func (slf UnixDomainSocket) OnUDSConnectionClosedEvent(conn *UnixDomainSocket, err any)

func (UnixDomainSocket) OnUDSConnectionOpenedEvent added in v0.0.31

func (slf UnixDomainSocket) OnUDSConnectionOpenedEvent(conn *UnixDomainSocket)

func (UnixDomainSocket) OnUDSConnectionReceivePacketEvent added in v0.0.31

func (slf UnixDomainSocket) OnUDSConnectionReceivePacketEvent(conn *UnixDomainSocket, packet server.Packet)

func (UnixDomainSocket) RegUDSConnectionClosedEvent added in v0.0.31

func (slf UnixDomainSocket) RegUDSConnectionClosedEvent(handle UDSConnectionClosedEventHandle)

RegUDSConnectionClosedEvent 注册连接关闭事件

func (UnixDomainSocket) RegUDSConnectionOpenedEvent added in v0.0.31

func (slf UnixDomainSocket) RegUDSConnectionOpenedEvent(handle UDSConnectionOpenedEventHandle)

RegUDSConnectionOpenedEvent 注册连接打开事件

func (UnixDomainSocket) RegUDSConnectionReceivePacketEvent added in v0.0.31

func (slf UnixDomainSocket) RegUDSConnectionReceivePacketEvent(handle UDSConnectionReceivePacketEventHandle)

RegUDSConnectionReceivePacketEvent 注册连接接收数据包事件

func (*UnixDomainSocket) Run added in v0.0.31

func (slf *UnixDomainSocket) Run() error

Run 启动

func (*UnixDomainSocket) SetData added in v0.0.31

func (slf *UnixDomainSocket) SetData(key string, value any)

SetData 设置数据

func (*UnixDomainSocket) Write added in v0.0.31

func (slf *UnixDomainSocket) Write(packet server.Packet)

Write 向连接中写入数据

type Websocket

type Websocket struct {
	// contains filtered or unexported fields
}

Websocket websocket 客户端

func NewWebsocket

func NewWebsocket(addr string) *Websocket

NewWebsocket 创建 websocket 客户端

func (*Websocket) Close

func (slf *Websocket) Close()

Close 关闭

func (*Websocket) GetData

func (slf *Websocket) GetData(key string) any

GetData 获取数据

func (*Websocket) IsConnected

func (slf *Websocket) IsConnected() bool

IsConnected 是否已连接

func (Websocket) OnWebsocketConnectionClosedEvent added in v0.0.31

func (slf Websocket) OnWebsocketConnectionClosedEvent(conn *Websocket, err any)

func (Websocket) OnWebsocketConnectionOpenedEvent added in v0.0.31

func (slf Websocket) OnWebsocketConnectionOpenedEvent(conn *Websocket)

func (Websocket) OnWebsocketConnectionReceivePacketEvent added in v0.0.31

func (slf Websocket) OnWebsocketConnectionReceivePacketEvent(conn *Websocket, packet server.Packet)

func (Websocket) RegWebsocketConnectionClosedEvent added in v0.0.31

func (slf Websocket) RegWebsocketConnectionClosedEvent(handle WebsocketConnectionClosedEventHandle)

RegWebsocketConnectionClosedEvent 注册连接关闭事件

func (Websocket) RegWebsocketConnectionOpenedEvent added in v0.0.31

func (slf Websocket) RegWebsocketConnectionOpenedEvent(handle WebsocketConnectionOpenedEventHandle)

RegWebsocketConnectionOpenedEvent 注册连接打开事件

func (Websocket) RegWebsocketConnectionReceivePacketEvent added in v0.0.31

func (slf Websocket) RegWebsocketConnectionReceivePacketEvent(handle WebsocketConnectionReceivePacketEventHandle)

RegWebsocketConnectionReceivePacketEvent 注册连接接收数据包事件

func (*Websocket) Run

func (slf *Websocket) Run() error

Run 启动

func (*Websocket) SetData

func (slf *Websocket) SetData(key string, value any)

SetData 设置数据

func (*Websocket) Write

func (slf *Websocket) Write(packet server.Packet)

Write 向连接中写入数据

  • messageType: websocket模式中指定消息类型

type WebsocketConnectionClosedEventHandle added in v0.0.31

type WebsocketConnectionClosedEventHandle func(conn *Websocket, err any)

type WebsocketConnectionOpenedEventHandle added in v0.0.31

type WebsocketConnectionOpenedEventHandle func(conn *Websocket)

type WebsocketConnectionReceivePacketEventHandle added in v0.0.31

type WebsocketConnectionReceivePacketEventHandle func(conn *Websocket, packet server.Packet)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL