model

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package model is a generated protocol buffer package.

It is generated from these files:

app/job/main/dm2/model/dm.proto

It has these top-level messages:

DM
Content
ContentSpecial
Elem
DMSeg

Index

Constants

View Source
const (
	ActFlushDM    = "flush"        // 刷新弹幕缓存
	ActReportDel  = "report_del"   // 删除举报弹幕
	ActAddDM      = "dm_add"       // 新增弹幕
	ActFlushDMSeg = "dm_seg_flush" // 刷新分段弹幕缓存
)

action from DMAction-T

View Source
const (
	SpamBlack    = 52001
	SpamOverflow = 52002
	SpamRestrict = 52005

	LiveDanmuMsgTypeNormal = 0
)

Spam .

View Source
const (
	AttrNo  = int32(0) // 属性位为0
	AttrYes = int32(1) // 属性位为1

	AttrProtect = uint(0) // 保护弹幕

	StateNormal        = int32(0)  // 普通状态
	StateDelete        = int32(1)  // 删除状态
	StateHide          = int32(2)  // 隐藏状态
	StateBlock         = int32(3)  // 屏蔽状态
	StateFilter        = int32(4)  // 过滤状态
	StateMonitorBefore = int32(5)  // 先审后发
	StateMonitorAfter  = int32(6)  // 先发后审
	StateSystemFilter  = int32(7)  // 敏感词过滤
	StateReportDelete  = int32(8)  // 举报删除
	StateAdminDelete   = int32(9)  // 弹幕管理删除
	StateUserDelete    = int32(10) // 用户删除
	StateScriptDelete  = int32(11) // 举报脚本删除
	StateTaskDel       = int32(12) //弹幕任务删除

	// 弹幕模式
	ModeRolling = int32(1)
	ModeBottom  = int32(4)
	ModeTop     = int32(5)
	ModeReverse = int32(6)
	ModeSpecial = int32(7)
	ModeCode    = int32(8)
	ModeBAS     = int32(9)

	PoolNormal   = int32(0) // 普通弹幕池
	PoolSubtitle = int32(1) // 字幕弹幕池
	PoolSpecial  = int32(2) // 特殊弹幕池

	MaskPriorityHgih = int32(1) // 弹幕蒙版优先级高
	MaskPriorityLow  = int32(0) // 弹幕蒙版优先级低

	NotFound = int64(-1)
)

All const variable use in job

View Source
const (
	// DefaultVideoEnd 当视频时长不存在或者为0时的默认视频结尾时间点
	DefaultVideoEnd = 10 * 60 * 60 * 1000
	// DefaultPageSize 默认分段长度
	DefaultPageSize = 60 * 6 * 1000
)

const variable

View Source
const (
	SubTypeVideo = int32(1) // 主题类型

	SubStateOpen   = int32(0) // 主题打开
	SubStateClosed = int32(1) // 主题关闭

	AttrSubGuest         = uint(0) // 允许游客弹幕
	AttrSubSpolier       = uint(1) // 允许剧透弹幕
	AttrSubMission       = uint(2) // 允许活动弹幕
	AttrSubAdvance       = uint(3) // 允许高级弹幕
	AttrSubMonitorBefore = uint(4) // 弹幕先审后发
	AttrSubMonitorAfter  = uint(5) // 弹幕先发后审
	AttrSubMaskOpen      = uint(6) // 开启蒙版
	AttrSubMaskReady     = uint(7) // 蒙版生产完成

	MaskPlatWeb int8 = 0   // web端
	MaskPlatMbl int8 = 1   // 移动端
	MaskPlatAll int8 = 100 //全部端
)

All const variable used in job

View Source
const (
	TaskStateSearch = int32(2) //查询执行中
	TaskStateDelDM  = int32(3) //删除执行中
	TaskStateFail   = int32(4) //执行失败
	TaskStatePause  = int32(5) //任务中断
	TaskStateSuc    = int32(6) //执行成功
	TaskStateDel    = int32(8) //任务被删除
	TaskStateWait   = int32(9) //等待执行删除

	// 数据平台返回的弹幕任务查询状态
	TaskSearchSuc  = int32(1) // 查询完成
	TaskSearchFail = int32(2) // 查询失败

	// 企业微信通知
	TaskNoticeTitle   = "弹幕任务删除过多告警"
	TaskNoticeContent = "弹幕任务(id:%d, title:%s)已删除%d条弹幕,已经被暂停,请前往管理后台查看"
)

const var

View Source
const (
	StatInit      = 0
	StatFinished  = 1
	StatFailed    = 2
	StatTransfing = 3
)

dm transfer state

View Source
const (
	// RouteSecondRound 稿件二审消息
	RouteSecondRound = "second_round"
	// RouteAutoOpen = 稿件自动开放浏览
	RouteAutoOpen = "auto_open"
	// RouteForceSync 稿件强制同步
	RouteForceSync = "force_sync"
	// RouteDelayOpen 稿件定时开放浏览
	RouteDelayOpen = "delay_open"
	// VideoStatusOpen 视频开放浏览
	VideoStatusOpen = int32(0)
	//VideoXcodeHDFinish  高清转码完成
	VideoXcodeHDFinish = int32(4)
	//VideoXcodeFinish   视频转码
	VideoXcodeFinish = int32(2)
)

Variables

View Source
var (
	ErrInvalidLengthDm = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowDm   = fmt.Errorf("proto: integer overflow")
)
View Source
var (

	// DefaultPage default page info
	DefaultPage = &Page{Num: 1, Size: DefaultVideoEnd, Total: 1}
)

Functions

func ConvertStime

func ConvertStime(t time.Time) stime

ConvertStime .

func SegmentPoint

func SegmentPoint(num, duration int64) (ps, pe int64)

SegmentPoint 根据当前段数和视频总时长计算分段的起始时间点

Types

type Action

type Action struct {
	Action string          `json:"action"`
	Data   json.RawMessage `json:"data"`
}

Action action message

type Archive

type Archive struct {
	Aid int64 `json:"aid"`
	Mid int64 `json:"mid"`
}

Archive archive info.

type BinlogMsg

type BinlogMsg struct {
	Action string          `json:"action"`
	Table  string          `json:"table"`
	New    json.RawMessage `json:"new"`
	Old    json.RawMessage `json:"old"`
}

BinlogMsg binlog msg produced by canal

type BnjLiveConfig

type BnjLiveConfig struct {
	DanmuDtarTime string `json:"danmu_start_time"`
	CommentID     int64  `json:"comment_id"`
	RoomID        int64  `json:"room_id"`
}

BnjLiveConfig .

type Content

type Content struct {
	ID       int64                       `protobuf:"varint,1,opt,name=ID,proto3" json:"id"`
	FontSize int32                       `protobuf:"varint,2,opt,name=FontSize,proto3" json:"fontsize"`
	Color    int64                       `protobuf:"varint,3,opt,name=Color,proto3" json:"color"`
	Mode     int32                       `protobuf:"varint,4,opt,name=Mode,proto3" json:"mode"`
	IP       int64                       `protobuf:"varint,5,opt,name=IP,proto3" json:"ip"`
	Plat     int32                       `protobuf:"varint,6,opt,name=Plat,proto3" json:"plat"`
	Msg      string                      `protobuf:"bytes,7,opt,name=Msg,proto3" json:"msg"`
	Ctime    go_common_library_time.Time `protobuf:"varint,8,opt,name=Ctime,proto3,casttype=go-common/library/time.Time" json:"ctime"`
	Mtime    go_common_library_time.Time `protobuf:"varint,9,opt,name=Mtime,proto3,casttype=go-common/library/time.Time" json:"mtime"`
}

func (*Content) Descriptor

func (*Content) Descriptor() ([]byte, []int)

func (*Content) Marshal

func (m *Content) Marshal() (dAtA []byte, err error)

func (*Content) MarshalTo

func (m *Content) MarshalTo(dAtA []byte) (int, error)

func (*Content) ProtoMessage

func (*Content) ProtoMessage()

func (*Content) Reset

func (m *Content) Reset()

func (*Content) Size

func (m *Content) Size() (n int)

func (*Content) String

func (m *Content) String() string

func (*Content) Unmarshal

func (m *Content) Unmarshal(dAtA []byte) error

type ContentSpecial

type ContentSpecial struct {
	ID    int64                       `protobuf:"varint,1,opt,name=ID,proto3" json:"id"`
	Msg   string                      `protobuf:"bytes,2,opt,name=Msg,proto3" json:"msg"`
	Ctime go_common_library_time.Time `protobuf:"varint,3,opt,name=Ctime,proto3,casttype=go-common/library/time.Time" json:"ctime"`
	Mtime go_common_library_time.Time `protobuf:"varint,4,opt,name=Mtime,proto3,casttype=go-common/library/time.Time" json:"mtime"`
}

func (*ContentSpecial) Descriptor

func (*ContentSpecial) Descriptor() ([]byte, []int)

func (*ContentSpecial) Marshal

func (m *ContentSpecial) Marshal() (dAtA []byte, err error)

func (*ContentSpecial) MarshalTo

func (m *ContentSpecial) MarshalTo(dAtA []byte) (int, error)

func (*ContentSpecial) ProtoMessage

func (*ContentSpecial) ProtoMessage()

func (*ContentSpecial) Reset

func (m *ContentSpecial) Reset()

func (*ContentSpecial) Size

func (m *ContentSpecial) Size() (n int)

func (*ContentSpecial) String

func (m *ContentSpecial) String() string

func (*ContentSpecial) Unmarshal

func (m *ContentSpecial) Unmarshal(dAtA []byte) error

type DM

type DM struct {
	ID         int64           `protobuf:"varint,1,opt,name=ID,proto3" json:"id"`
	Type       int32           `protobuf:"varint,2,opt,name=Type,proto3" json:"type"`
	Oid        int64           `protobuf:"varint,3,opt,name=Oid,proto3" json:"oid"`
	Mid        int64           `protobuf:"varint,4,opt,name=Mid,proto3" json:"mid"`
	Progress   int32           `protobuf:"varint,5,opt,name=Progress,proto3" json:"progress"`
	Pool       int32           `protobuf:"varint,6,opt,name=Pool,proto3" json:"pool"`
	Attr       int32           `protobuf:"varint,7,opt,name=Attr,proto3" json:"attr"`
	State      int32           `protobuf:"varint,8,opt,name=State,proto3" json:"state"`
	Ctime      stime           `protobuf:"varint,9,opt,name=Ctime,proto3,casttype=stime" json:"ctime"`
	Mtime      stime           `protobuf:"varint,10,opt,name=Mtime,proto3,casttype=stime" json:"mtime"`
	Content    *Content        `protobuf:"bytes,11,opt,name=Content" json:"content,omitempty"`
	ContentSpe *ContentSpecial `protobuf:"bytes,12,opt,name=ContentSpe" json:"content_special,omitempty"`
}

func (*DM) AttrSet

func (d *DM) AttrSet(v int32, bit uint)

AttrSet set val of index'attr

func (*DM) AttrVal

func (d *DM) AttrVal(bit uint) int32

AttrVal return val of index'attr

func (*DM) Descriptor

func (*DM) Descriptor() ([]byte, []int)

func (*DM) GetSpecialSeg

func (d *DM) GetSpecialSeg() (msg string)

GetSpecialSeg .

func (*DM) Marshal

func (m *DM) Marshal() (dAtA []byte, err error)

func (*DM) MarshalTo

func (m *DM) MarshalTo(dAtA []byte) (int, error)

func (*DM) NeedDisplay

func (d *DM) NeedDisplay() bool

NeedDisplay 判断该条弹幕是否需要展示

func (*DM) NeedUpdateSpecial

func (d *DM) NeedUpdateSpecial(old *DM) bool

NeedUpdateSpecial .

func (*DM) ProtoMessage

func (*DM) ProtoMessage()

func (*DM) Reset

func (m *DM) Reset()

func (*DM) Size

func (m *DM) Size() (n int)

func (*DM) String

func (m *DM) String() string

func (*DM) ToElem

func (d *DM) ToElem() (e *Elem)

ToElem convert dm struct to element.

func (*DM) ToXML

func (d *DM) ToXML(realname bool) (s string)

ToXML convert dm struct to xml.

func (*DM) ToXMLSeg

func (d *DM) ToXMLSeg() (s string)

ToXMLSeg convert dm struct to xml.

func (*DM) Unmarshal

func (m *DM) Unmarshal(dAtA []byte) error

type DMSeg

type DMSeg struct {
	Elems      []*Elem  `protobuf:"bytes,1,rep,name=Elems" json:"dms"`
	SpecialURL []string `protobuf:"bytes,2,rep,name=SpecialURL" json:"special_url,omitempty"`
}

func (*DMSeg) Descriptor

func (*DMSeg) Descriptor() ([]byte, []int)

func (*DMSeg) Marshal

func (m *DMSeg) Marshal() (dAtA []byte, err error)

func (*DMSeg) MarshalTo

func (m *DMSeg) MarshalTo(dAtA []byte) (int, error)

func (*DMSeg) ProtoMessage

func (*DMSeg) ProtoMessage()

func (*DMSeg) Reset

func (m *DMSeg) Reset()

func (*DMSeg) Size

func (m *DMSeg) Size() (n int)

func (*DMSeg) String

func (m *DMSeg) String() string

func (*DMSeg) Unmarshal

func (m *DMSeg) Unmarshal(dAtA []byte) error

type DMSlice

type DMSlice []*DM

DMSlice dm array

func (DMSlice) Len

func (d DMSlice) Len() int

func (DMSlice) Less

func (d DMSlice) Less(i, j int) bool

func (DMSlice) Swap

func (d DMSlice) Swap(i, j int)

type DmSpecial

type DmSpecial struct {
	ID        int64
	Type      int32
	Oid       int64
	Locations string
}

DmSpecial special dm bfs location

func (*DmSpecial) Find

func (d *DmSpecial) Find(sha1Sum string) string

Find find url if exist

func (*DmSpecial) Join

func (d *DmSpecial) Join(s []string)

Join .

func (*DmSpecial) Split

func (d *DmSpecial) Split() []string

Split .

type DmSpecialContent

type DmSpecialContent struct {
	ID      int64  `json:"id"`
	Content string `json:"content"`
}

DmSpecialContent .

type Elem

type Elem struct {
	Attribute string `protobuf:"bytes,1,opt,name=Attribute,proto3" json:"attribute,omitempty"`
	Content   string `protobuf:"bytes,2,opt,name=Content,proto3" json:"content,omitempty"`
}

func (*Elem) Descriptor

func (*Elem) Descriptor() ([]byte, []int)

func (*Elem) Marshal

func (m *Elem) Marshal() (dAtA []byte, err error)

func (*Elem) MarshalTo

func (m *Elem) MarshalTo(dAtA []byte) (int, error)

func (*Elem) ProtoMessage

func (*Elem) ProtoMessage()

func (*Elem) Reset

func (m *Elem) Reset()

func (*Elem) Size

func (m *Elem) Size() (n int)

func (*Elem) String

func (m *Elem) String() string

func (*Elem) Unmarshal

func (m *Elem) Unmarshal(dAtA []byte) error

type Flush

type Flush struct {
	Type  int32 `json:"type"`
	Oid   int64 `json:"oid"`
	Force bool  `json:"force"`
}

Flush flush cache message

type FlushDMSeg

type FlushDMSeg struct {
	Type  int32 `json:"type"`
	Oid   int64 `json:"oid"`
	Force bool  `json:"force"`
	Page  *Page `json:"page"`
}

FlushDMSeg flush segment dm cache

type LiveDanmu

type LiveDanmu struct {
	RoomID    int64  `json:"room_id"`
	UID       int64  `json:"uid"`
	UName     string `json:"uname"`
	UserLevel int32  `json:"user_level"`
	Color     int32  `json:"color"`
	Content   string `json:"content"`
	Time      int64  `json:"time"`
	MsgType   int32  `json:"msg_type"`
}

LiveDanmu .

type Page

type Page struct {
	Num   int64 `json:"num"`
	Size  int64 `json:"size"`
	Total int64 `json:"total"`
}

Page dm page info

type RankRecentRegion

type RankRecentRegion struct {
	Aid    int64               `json:"aid"`
	Mid    int64               `json:"mid"`
	Others []*RankRecentRegion `json:"others"`
}

RankRecentRegion 分区排行榜

type RankRecentResp

type RankRecentResp struct {
	Code int32               `json:"code"`
	List []*RankRecentRegion `json:"list"`
	Num  int32               `json:"num"`
}

RankRecentResp .

type ReportAction

type ReportAction struct {
	Cid      int64 `json:"cid"`       // 视频id
	Did      int64 `json:"dmid"`      // 弹幕id
	HideTime int64 `json:"hide_time"` // 弹幕隐截止j时间
}

ReportAction report message

type Segment

type Segment struct {
	Start    int64 `json:"ps"`       // 分段起始时间
	End      int64 `json:"pe"`       // 分段结束时间
	Cnt      int64 `json:"cnt"`      // 总分段数
	Num      int64 `json:"num"`      // 当前第几段
	Duration int64 `json:"duration"` // 视频总时长
}

Segment dm segment struct

func SegmentInfo

func SegmentInfo(ps, duration int64) (s *Segment)

SegmentInfo get segment info by start time and video duration.

func (*Segment) ToXMLHeader

func (s *Segment) ToXMLHeader(oid int64, state, realname int32) string

ToXMLHeader convert segment to xml header format.

type SubTask

type SubTask struct {
	ID        int64
	Operation int32
	Rate      int32
	Tcount    int64 //删除总数
	Start     time.Time
	End       time.Time
}

SubTask .

type Subject

type Subject struct {
	ID        int64 `json:"id"`
	Type      int32 `json:"type"`
	Oid       int64 `json:"oid"`
	Pid       int64 `json:"pid"`
	Mid       int64 `json:"mid"`
	State     int32 `json:"state"`
	Attr      int32 `json:"attr"`
	ACount    int64 `json:"acount"`
	Count     int64 `json:"count"`
	MCount    int64 `json:"mcount"`
	MoveCnt   int64 `json:"move_count"`
	Maxlimit  int64 `json:"maxlimit"`
	Childpool int32 `json:"childpool"`
	Ctime     stime `json:"ctime"`
	Mtime     stime `json:"mtime"`
}

Subject dm_subject.

func (*Subject) AttrSet

func (s *Subject) AttrSet(v int32, bit uint)

AttrSet set val of subject'attr

func (*Subject) AttrVal

func (s *Subject) AttrVal(bit uint) int32

AttrVal return val of subject'attr

type Subtitle

type Subtitle struct {
	ID            int64          `json:"id"`
	Oid           int64          `json:"oid"`
	Type          int32          `json:"type"`
	Lan           uint8          `json:"lan"`
	Aid           int64          `json:"aid"`
	Mid           int64          `json:"mid"`
	UpMid         int64          `json:"up_mid"`
	Status        SubtitleStatus `json:"status"`
	SubtitleURL   string         `json:"subtitle_url"`
	PubTime       int64          `json:"pub_time"`
	RejectComment string         `json:"reject_comment"`
}

Subtitle .

type SubtitleAuditMsg

type SubtitleAuditMsg struct {
	SubtitleID int64 `json:"subtitle_id"`
	Oid        int64 `json:"oid"`
}

SubtitleAuditMsg .

type SubtitleBody

type SubtitleBody struct {
	FontSize        float64         `json:"font_size,omitempty"`
	FontColor       string          `json:"font_color,omitempty"`
	BackgroundAlpha float64         `json:"background_alpha,omitempty"`
	BackgroundColor string          `json:"background_color,omitempty"`
	Stroke          string          `json:"Stroke,omitempty"`
	Bodys           []*SubtitleItem `json:"body"`
}

SubtitleBody .

type SubtitleItem

type SubtitleItem struct {
	From     float64 `json:"from"`
	To       float64 `json:"to"`
	Location int8    `json:"location"`
	Content  string  `json:"content"`
}

SubtitleItem .

type SubtitlePub

type SubtitlePub struct {
	Oid        int64
	Type       int32
	Lan        uint8
	SubtitleID int64
	IsDelete   bool
}

SubtitlePub .

type SubtitleStatus

type SubtitleStatus uint8

SubtitleStatus .

const (
	SubtitleStatusUnknown SubtitleStatus = iota
	SubtitleStatusDraft
	SubtitleStatusToAudit
	SubtitleStatusAuditBack
	SubtitleStatusRemove
	SubtitleStatusPublish
	SubtitleStatusCheckToAudit
	SubtitleStatusCheckPublish
)

SubtitleStatus

type TaskInfo

type TaskInfo struct {
	ID        int64
	Topic     string
	State     int32
	Count     int64
	Result    string
	Sub       int32
	LastIndex int32
	Priority  int64
	Title     string
	Creator   string
	Reviewer  string
}

TaskInfo .

type Transfer

type Transfer struct {
	ID      int64
	FromCid int64
	ToCid   int64
	Mid     int64
	Offset  float64
	State   int8
	Dmid    int64
	Ctime   time.Time
	Mtime   time.Time
}

Transfer dm transfer task

type Video

type Video struct {
	Aid        int64 `json:"aid"`
	Cid        int64 `json:"cid"`
	Mid        int64 `json:"mid"`
	Duration   int64 `json:"duration"`
	Status     int32 `json:"status"`
	XCodeState int32 `json:"xcode_state"`
}

Video video info.

type VideoupMsg

type VideoupMsg struct {
	Route string `json:"route"`
	Aid   int64  `json:"aid"`
}

VideoupMsg second round msg from VideoupBvc.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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