http

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2021 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWsClient

func NewWsClient(schema string, ip string, port string, path string, timeout time.Duration) *client

构造函数

func Regist

func Regist(handler func(data []byte, conn *Connection) ([]byte, error))

* 注册读取原生数据的处理器,receiver.HandleChainMessage是选择之一

func SendRaw

func SendRaw(sessionId string, data []byte) error

* 主动发回信息

func Start

func Start()

Types

type Connection

type Connection struct {
	Session   *session2.Session
	WsConnect *websocket.Conn
	// contains filtered or unexported fields
}

func (*Connection) Close

func (conn *Connection) Close()

func (*Connection) Write

func (conn *Connection) Write(messageType int, data []byte) (err error)

type WebsocketMessage

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

Jump to

Keyboard shortcuts

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