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: 10 Imported by: 0

Documentation

Overview

Package model is a generated protocol buffer package.

It is generated from these files:

dm.proto

It has these top-level messages:

DM
Content
ContentSpecial

Index

Constants

View Source
const (
	AttrNo  = int32(0)
	AttrYes = int32(1)

	// platform
	PlatUnknow  = int32(0)
	PlatWeb     = int32(1)
	PlatAndroid = int32(2)
	PlatIPhone  = int32(3)
	PlatWpM     = int32(4) // wp mobile
	PlatIPad    = int32(5)
	PlatPadHd   = int32(6) // ipad hd
	PlatWpPc    = int32(7) // win10

	// dm state
	StateNormal        = int32(0) // 普通状态
	StateDelete        = int32(1) // 删除状态
	StateHide          = int32(2) // 隐藏状态
	StateBlock         = int32(3) // 屏蔽状态
	StateFilter        = int32(4) // 过滤状态
	StateMonitorBefore = int32(5) // 先审后发
	StateMonitorAfter  = int32(6) // 先发后审

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

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

	// dm mode
	ModeNormal  = int32(1) // 正常滚动弹幕
	ModeBottom  = int32(4) // 底部弹幕
	ModeTop     = int32(5) // 顶部弹幕
	ModeReverse = int32(6) // 逆向滚动弹幕
	ModeAdvance = int32(7) // 高级弹幕
	ModeCode    = int32(8) // 代码弹幕

	NotFound = int64(-1)
)

all const variable used in job

View Source
const (
	// binlog type
	SyncInsert = "insert"
	SyncUpdate = "update"
	SyncDelete = "delete"
)

All const variable used in job

View Source
const (

	// DefaultVideoEnd 当视频时长不存在或者为0时的默认视频结尾时间点
	DefaultVideoEnd = int64(10 * 60 * 60 * 1000)

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

	// AttrSubGuest 允许游客弹幕
	AttrSubGuest = uint(0)
	// AttrSubSpolier 允许剧透弹幕
	AttrSubSpolier = uint(1)
	// AttrSubMission 允许活动弹幕
	AttrSubMission = uint(2)
	// AttrSubAdvance 允许高级弹幕
	AttrSubAdvance = uint(3)
	// AttrSubMonitorBefore 弹幕先审后发
	AttrSubMonitorBefore = uint(4)
	// AttrSubMonitorAfter 弹幕先发后审
	AttrSubMonitorAfter = uint(5)
)

Variables

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

Functions

func SegmentPoint

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

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

Types

type BinlogMsg

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

BinlogMsg dm binlog msg

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_time.Time `protobuf:"varint,8,opt,name=Ctime,proto3,casttype=go-common/library/time.Time" json:"ctime"`
	Mtime    go_common_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) GetColor

func (m *Content) GetColor() int64

func (*Content) GetCtime

func (m *Content) GetCtime() go_common_time.Time

func (*Content) GetFontSize

func (m *Content) GetFontSize() int32

func (*Content) GetID

func (m *Content) GetID() int64

func (*Content) GetIP

func (m *Content) GetIP() int64

func (*Content) GetMode

func (m *Content) GetMode() int32

func (*Content) GetMsg

func (m *Content) GetMsg() string

func (*Content) GetMtime

func (m *Content) GetMtime() go_common_time.Time

func (*Content) GetPlat

func (m *Content) GetPlat() int32

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_time.Time `protobuf:"varint,3,opt,name=Ctime,proto3,casttype=go-common/library/time.Time" json:"ctime"`
	Mtime go_common_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) GetCtime

func (m *ContentSpecial) GetCtime() go_common_time.Time

func (*ContentSpecial) GetID

func (m *ContentSpecial) GetID() int64

func (*ContentSpecial) GetMsg

func (m *ContentSpecial) GetMsg() string

func (*ContentSpecial) GetMtime

func (m *ContentSpecial) GetMtime() go_common_time.Time

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) GetAttr

func (m *DM) GetAttr() int32

func (*DM) GetContent

func (m *DM) GetContent() *Content

func (*DM) GetContentSpe

func (m *DM) GetContentSpe() *ContentSpecial

func (*DM) GetCtime

func (m *DM) GetCtime() stime

func (*DM) GetID

func (m *DM) GetID() int64

func (*DM) GetMid

func (m *DM) GetMid() int64

func (*DM) GetMtime

func (m *DM) GetMtime() stime

func (*DM) GetOid

func (m *DM) GetOid() int64

func (*DM) GetPool

func (m *DM) GetPool() int32

func (*DM) GetProgress

func (m *DM) GetProgress() int32

func (*DM) GetState

func (m *DM) GetState() int32

func (*DM) GetType

func (m *DM) GetType() int32

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) NeedStateNormal

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

NeedStateNormal 判断是否更新状态 pool0 变为 pool1 状态正常 变为保护弹幕 状态正常

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) Unmarshal

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

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.

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     time.Time `json:"ctime"`
	MTime     time.Time `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 Trim

type Trim struct {
	ID   int64 `json:"id"`
	Attr int32 `json:"-"`
}

Trim dmid and it's progress time will be trimed.

Jump to

Keyboard shortcuts

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