cv

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: MIT Imports: 20 Imported by: 1

README


目录释义

目录 说明
./ 全局变常量
Const.go 全局常数
Var.go 全局变量

Documentation

Index

Constants

View Source
const (
	WS_OP_HEARTBEAT                  = 2
	WS_OP_HEARTBEAT_REPLY            = 3
	WS_OP_MESSAGE                    = 5
	WS_OP_USER_AUTHENTICATION        = 7
	WS_OP_CONNECT_SUCCESS            = 8
	WS_PACKAGE_HEADER_TOTAL_LENGTH   = 16
	WS_PACKAGE_OFFSET                = 0
	WS_HEADER_OFFSET                 = 4
	WS_VERSION_OFFSET                = 6
	WS_OPERATION_OFFSET              = 8
	WS_SEQUENCE_OFFSET               = 12
	WS_BODY_PROTOCOL_VERSION_NORMAL  = 0
	WS_BODY_PROTOCOL_VERSION_DEFLATE = 2
	WS_BODY_PROTOCOL_VERSION_BROTLI  = 3
	WS_HEADER_DEFAULT_VERSION        = 1
	WS_HEADER_DEFAULT_OPERATION      = 1
	WS_HEADER_DEFAULT_SEQUENCE       = 1
	WS_AUTH_OK                       = 0
	WS_AUTH_TOKEN_ERROR              = -101
)
View Source
const (
	Protover = 3
	Platform = "web"
	Type     = 2
)

Variables

View Source
var C = new(Common).Init()

Functions

This section is empty.

Types

type Common added in v0.5.10

type Common struct {
	PID               int                   //进程id
	Uid               int                   //client uid
	Live              []LiveQn              //直播流链接
	Live_qn           int                   //当前直播流质量
	Live_want_qn      int                   //期望直播流质量
	Roomid            int                   //房间ID
	Cookie            syncmap.Map           //Cookie
	Title             string                //直播标题
	Uname             string                //主播名
	UpUid             int                   //主播uid
	Rev               float64               //营收
	Renqi             int                   //人气
	Watched           int                   //观看人数
	OnlineNum         int                   //在线人数
	GuardNum          int                   //舰长数
	ParentAreaID      int                   //父分区
	AreaID            int                   //子分区
	Locked            bool                  //直播间封禁
	Note              string                //分区排行
	Live_Start_Time   time.Time             //直播开始时间
	Liveing           bool                  //是否在直播
	Wearing_FansMedal int                   //当前佩戴的粉丝牌
	Token             string                //弹幕钥
	WSURL             []string              //弹幕链接
	LiveBuvidUpdated  time.Time             //LIVE_BUVID更新时间
	Stream_url        *url.URL              //直播Web服务
	Proxy             string                //全局代理
	AcceptQn          map[int]string        //允许的直播流质量
	Qn                map[int]string        //全部直播流质量
	StreamType        StreamType            //当前直播流类型
	AllStreamType     map[string]StreamType //直播流类型
	K_v               syncmap.Map           //配置文件
	Log               *log.Log_interface    //日志
	Danmu_Main_mq     *mq.Msgq              //消息
	ReqPool           *pool.Buf[reqf.Req]   //请求池
	SerF              *web.WebPath          //web服务处理
	StartT            time.Time             //启动时间
}

func (*Common) Copy added in v0.7.2

func (t *Common) Copy() *Common

func (*Common) DisableLive added in v0.5.11

func (t *Common) DisableLive(host string, reUpTime time.Time)

func (*Common) DisableLiveAuto added in v0.6.1

func (t *Common) DisableLiveAuto(host string)

自动停用机制

func (*Common) Init added in v0.5.11

func (t *Common) Init() *Common

func (*Common) IsOn added in v0.7.2

func (t *Common) IsOn(key string) bool

func (*Common) ValidLive added in v0.5.11

func (t *Common) ValidLive() *LiveQn

type Danmu_Main_mq_item

type Danmu_Main_mq_item struct {
	Class string
	Data  interface{}
}

消息队列

type LiveQn added in v0.5.11

type LiveQn struct {
	Url      string
	ReUpTime time.Time

	Expires int //流到期时间
	// contains filtered or unexported fields
}

func (*LiveQn) Disable added in v0.5.11

func (t *LiveQn) Disable(reUpTime time.Time)

func (*LiveQn) DisableAuto added in v0.6.1

func (t *LiveQn) DisableAuto()

自动停用机制

func (*LiveQn) Host added in v0.5.11

func (t *LiveQn) Host() string

func (*LiveQn) Valid added in v0.5.11

func (t *LiveQn) Valid() bool

type ResStruct added in v0.6.2

type ResStruct struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    any    `json:"data"`
}

Web服务响应格式

func (ResStruct) Write added in v0.6.2

func (t ResStruct) Write(w http.ResponseWriter)

type StreamType added in v0.5.11

type StreamType struct {
	Protocol_name string
	Format_name   string
	Codec_name    string
}

Jump to

Keyboard shortcuts

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