notice

package
v0.0.0-...-b9c356b Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: AGPL-3.0 Imports: 8 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(r *ghttp.Request, errorCode ErrorCode, data interface{})

Write 新版本以model的形式返回结果

func WsCloseMessageListener

func WsCloseMessageListener(wsHandle *ghttp.WebSocket)

WsCloseMessageListener 停止一个wsHandle的消息监听

func WsSendBinaryMessage

func WsSendBinaryMessage(wsHandle *ghttp.WebSocket, msgContent []byte)

WsSendBinaryMessage 发送二进制消息

func WsSendJsonMessage

func WsSendJsonMessage(wsHandle *ghttp.WebSocket, msgContent *WSMsg)

WsSendJsonMessage 发送json消息

func WsSendJsonMessageToAll

func WsSendJsonMessageToAll(msgContent *WSMsg)

func WsValidateSign

func WsValidateSign(msg *WSMsg) bool

WsValidateSign 验签

Types

type ErrorCode

type ErrorCode int
const (
	NoError       ErrorCode = 0
	OtherError    ErrorCode = 400
	NotAuth       ErrorCode = 401
	NoPrint       ErrorCode = 402
	AuthForbidden ErrorCode = 403
	NotFind       ErrorCode = 404
	ShowDialog    ErrorCode = 405
)

type HttpModel

type HttpModel struct {
	Error   ErrorCode   `json:"error"`
	Message interface{} `json:"message"`
}

type HttpShowDialogMessage

type HttpShowDialogMessage struct {
	Data        string `json:"data"`
	ConfirmText string `json:"confirm_text"`
	ConfirmJump string `json:"confirm_jump"`
}

type WSMsg

type WSMsg struct {
	Type WSMsgType   `json:"type"`
	Time string      `json:"time"`
	Sign string      `json:"sign"`
	Data interface{} `json:"data"`
}

type WSMsgType

type WSMsgType string

Jump to

Keyboard shortcuts

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