ws

package
v0.55.3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Preparing  = "preparing"
	ScanMovie  = "scan-movie"
	ScanSeries = "scan-series"
	Waiting    = "waiting"
)

Variables

View Source
var CloseThisConnect = []byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 9, 8, 7, 6, 5, 4, 3, 2, 1}

Functions

This section is empty.

Types

type AuthMessage

type AuthMessage int
const (
	AuthOk AuthMessage = iota
	AuthError
)

func (AuthMessage) String

func (c AuthMessage) String() string

type BaseMessage

type BaseMessage struct {
	Type string `json:"type"`
	Data string `json:"data"` // 收到具体的消息需要从这里二次解析,判断类型由 Type 决定
}

BaseMessage 基础的消息结构,附带的信息会在其中的 data 字段需要二次解析

func NewBaseMessage

func NewBaseMessage(typeInfo, dataInfo string) *BaseMessage

func (*BaseMessage) Bytes

func (b *BaseMessage) Bytes() ([]byte, error)

type CommonMessage

type CommonMessage int
const (
	OK CommonMessage = iota
)

func (CommonMessage) String

func (c CommonMessage) String() string

type Login

type Login struct {
	Token string `json:"token"`
}

type Reply

type Reply struct {
	Message string `json:"message"`
}

type RunningLogMessage

type RunningLogMessage int
const (
	RunningLogRevOk RunningLogMessage = iota
	RunningLogRevError
)

func (RunningLogMessage) String

func (c RunningLogMessage) String() string

type WSType

type WSType int
const (
	CommonReply           WSType = iota // 通用回复
	Auth                                // Client 发送登录握手消息
	RunningLog                          // Server 回复 Log 的信息
	SubDownloadJobsStatus               // Server 主动发送的字幕下载任务状态信息
)

func (WSType) String

func (c WSType) String() string

Jump to

Keyboard shortcuts

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