Documentation ¶
Index ¶
- Constants
- Variables
- func CheckAction(act int8) (err error)
- func CheckPlat(plat int8) bool
- func CheckReportReason(reason int8) (err error)
- func CheckSort(sort int8) bool
- func CheckSubForbid(state int8) (err error)
- func CheckSubState(state int8) (err error)
- func GetReportType(reason int8) int8
- func LegalSubjectType(tp int8) bool
- func ShouldShowFolded(mobi_app string, build, scene int64) bool
- func SortArr(arr []int64, cmp Comp) []int64
- func WithinSortRange(sort int8) bool
- type Action
- type ActionCount
- type AscFloors
- type Business
- type Comp
- type Config
- type Content
- type Counts
- type Cursor
- type CursorParams
- type DescFloors
- type DialogCursor
- type DialogMeta
- type Emoji
- type EmojiPackage
- type FansDetail
- type Folder
- type Info
- type Int64Bytes
- type Member
- type Mstr
- type Notice
- type PageParams
- type PageResult
- type Record
- type Reply
- func (r *Reply) AttrSet(v uint32, bit uint32)
- func (r *Reply) AttrVal(bit uint32) uint32
- func (r *Reply) Clone() (res *Reply)
- func (r *Reply) FillFolder()
- func (r *Reply) FillStr(isEscape bool)
- func (r *Reply) HasFolded() bool
- func (r *Reply) IsDeleted() bool
- func (r *Reply) IsFolded() bool
- func (r *Reply) IsNormal() bool
- func (r *Reply) IsRoot() bool
- func (r *Reply) IsTop() bool
- func (r *Reply) UnmarkHasFolded()
- type Report
- type ReportUser
- type RootReplyList
- type RootReplyListHeader
- type Subject
- type SubjectMeta
Constants ¶
const ( EQ = int8(0) // condition equal GT = int8(1) // greater LT = int8(2) // less )
eq
const ( // AttrNo attribute no AttrNo = uint32(0) // AttrYes attribute yes AttrYes = uint32(1) )
const ( Rule = "https://www.bilibili.com/blackboard/foldingreply.html" UserLevelFirst = 1 UserLevelSnd = 2 SubTypeArchive = int8(1) SubTypeTopic = int8(2) SubTypeDrawyoo = int8(3) SubTypeActivity = int8(4) SubTypeLive = int8(5) SubTypeForbiden = int8(6) // reply forbiden info SubTypeNotice = int8(7) //reply notice info SubTypeLiveAct = int8(8) SubTypeActArc = int8(9) SubTypeLiveNotice = int8(10) SubTypeLivePicture = int8(11) // 文画 SubTypeArticle = int8(12) // 文章 SubTypeTicket = int8(13) // 票务 SubTypeMusic = int8(14) // 音乐 SubTypeCredit = int8(15) // 风纪委 SubTypePgcCmt = int8(16) // pgc点评 SubTypeDynamic = int8(17) // 庐山动态 SubTypePlaylist = int8(18) // 播单 SubTypeMusicList = int8(19) // 音乐播单 SubTypeComicSeason = int8(20) // 漫画部评论 SubTypeComicEpisode = int8(21) // 漫画话评论 SubTypeHuoniao = int8(22) // 火鸟 SubTypeBBQ = int8(23) // BBQ SubTypePGC = int8(24) // PGC 全网落地页 SubTypeGame = int8(25) // 赛事库电竞 SubTypeMedialist = int8(26) // 播单(收藏夹) SubTypeEsportsInfo = int8(27) // 电竞项目比赛数据页 SubStateNormal = int8(0) SubStateForbid = int8(1) // Sub attr bit SubAttrAdminTop = uint32(0) SubAttrUpperTop = uint32(1) SubAttrMonitor = uint32(2) SubAttrConfig = uint32(3) SubAttrAudit = uint32(4) SubAttrFrozen = uint32(5) // 标识有被折叠的根评论 SubAttrFolded = uint32(7) ReplyStateNormal = int8(0) // normal ReplyStateHidden = int8(1) // hidden by up ReplyStateFiltered = int8(2) // filtered ReplyStateAdminDel = int8(3) // delete by admin ReplyStateUserDel = int8(4) // delete by user ReplyStateMonitor = int8(5) // reply after audit ReplyStateGarbage = int8(6) // spam reply ReplyStateTop = int8(7) // top ReplyStateUpDel = int8(8) // delete by up ReplyStateBlacklist = int8(9) // in a blacklist ReplyStateAssistDel = int8(10) // delete by assistant ReplyStateAudit = int8(11) // 监管中 ReplyStateFolded = int8(12) // 被折叠 ReplyAttrAdminTop = uint32(0) ReplyAttrUpperTop = uint32(1) ReplyAttrGarbage = uint32(2) ReplyAttrFilter = uint32(3) // 标识有被折叠的子评论 ReplyAttrFolded = uint32(7) SortByFloor = int8(0) SortByCount = int8(1) SortByLike = int8(2) ReportStateNew = int8(0) // 待一审 ReportStateDelete = int8(1) // 移除,已废弃 ReportStateIgnore = int8(2) // 忽略,已废弃 ReportStateDeleteOne = int8(3) // 一审移除 ReportStateNewTwo = int8(4) // 待二审 ReportStateDeleteTwo = int8(5) // 二审移除 ReportStateIgnoreTwo = int8(6) // 二审忽略 ReportStateIgnoreOne = int8(7) // 一审忽略 ReportStateTransferred = int8(8) // 举报转移风纪委 ReportAttrTransferred = uint(0) //标识举报State是否曾今从待一审\二审转换成待二审\一审 ReportUserStateNew = int8(0) // 新增 ReportUserStateReported = int8(1) // 已反馈 OpCancel = int8(0) // 取消赞踩 OpAdd = int8(1) // 添加赞踩 ActionNormal = int8(0) // 未踩赞 ActionLike = int8(1) // 赞 ActionHate = int8(2) // 踩 UpperOpHide = int8(1) UpperOpShow = int8(2) ReportReasonAd = int8(1) // 广告 ReportReasonPorn = int8(2) // 色情 ReportReasonMeaningless = int8(3) // 刷屏 ReportReasonProvoke = int8(4) // 引战 ReportReasonSpoiler = int8(5) // 剧透 ReportReasonPolitic = int8(6) // 政治 ReportReasonAttack = int8(7) // 人身攻击 ReportReasonProhibited = int8(9) // 违禁 ReportReasonVulgar = int8(10) // 低俗 ReportReasonIllegalWebsite = int8(11) // 非法网站 ReportReasonGamblingFraud = int8(12) // 赌博诈骗 ReportReasonRumor = int8(13) // 传播不实信息 ReportReasonAbetting = int8(14) // 怂恿教唆信息 ReportReasonPrivacyInvasion = int8(15) // 侵犯隐私 ReportReasonUnlimitedSign = int8(16) // 抢楼 ReportReasonYouthInappropriate = int8(17) // 青少年不良信息 ReportReasonOther = int8(0) // 其他 PlatUnknow = int8(0) PlatWeb = int8(1) PlatAndroid = int8(2) PlatIPhone = int8(3) PlatWpM = int8(4) // wp mobile PlatIPad = int8(5) PlatPadHd = int8(6) // ipad hd PlatWpPc = int8(7) // win10 PlatAndroidI = int8(8) // 国际版安卓 AdminOperDelete = int8(0) // admin delete AdminOperDeleteByReport = int8(1) // admin delete by report AdminOperIgnoreReport = int8(2) // admin ignore report AdminOperRecover = int8(3) // admin recover AdminOperEdit = int8(4) // admin edit reply content AdminOperPass = int8(5) // admin pass AdminOperSubState = int8(6) // admin change subject state AdminOperSubTop = int8(7) // top reply AdminOperSubMid = int8(8) // admin change subject mid AdminOperRptIgnore1 = int8(9) // admin report ignore 1 AdminOperRptIgnore2 = int8(10) // admin report ignore 2 AdminOperRptDel1 = int8(11) // admin report del 1 AdminOperRptDel2 = int8(12) // admin report del 2 AdminOperRptRecover1 = int8(13) // admin report recover 1 AdminOperRptRecover2 = int8(14) // admin report recover 2 AdminOperActionSet = int8(15) // admin action set AdminIsNotReport = int8(0) AdminIsReport = int8(1) AdminIsNotNew = int8(0) AdminIsNew = int8(1) AuditTypeOne = int8(1) // 一审 AuditTypeTwo = int8(2) // 二审 BlacklistRelation = int16(-1) ReportReplyAdd = "reply_add" ReportReplyDel = "reply_del" ReportReplyLike = "reply_like" ReportReplyHate = "reply_hate" ReportReplyCancelLike = "reply_cancel_like" ReportReplyCancelHate = "reply_cancel_hate" ReportReplyTop = "reply_top" ReportReplyUntop = "reply_untop" ReportReplyReport = "reply_report" )
subtype
const (
RecordTimeLayout = "2006-01-02 15:04:05"
)
time layout
Variables ¶
var ( OrderDESC = func(x, y int64) bool { return x > y } OrderASC = func(x, y int64) bool { return x < y } )
order
Functions ¶
func CheckReportReason ¶
CheckReportReason CheckReportReason
func ShouldShowFolded ¶
ShouldShowFolded ...
Types ¶
type Action ¶
type Action struct { ID int64 `json:"-"` RpID int64 `json:"rpid"` Action int8 `json:"action"` Mid int64 `json:"mid"` CTime xtime.Time `json:"-"` }
Action Action
type ActionCount ¶
ActionCount ActionCount
type Business ¶
type Business struct { Type int32 `json:"type"` Alias string `json:"alias"` Appkey string `json:"appkey"` }
Business Business
type Config ¶
type Config struct { ID int64 `json:"id"` Type int8 `json:"type"` Oid int64 `json:"oid"` AdminID int64 `json:"adminid"` Operator string `json:"operator"` Category int8 `json:"category"` Config string `json:"config"` ShowEntry int8 `json:"showentry"` ShowAdmin int8 `json:"showadmin"` CTime string `json:"ctime"` MTime string `json:"mtime"` }
Config reply config info.
type Content ¶
type Content struct { RpID int64 `json:"-"` Message string `json:"message"` Ats Int64Bytes `json:"ats,omitempty"` Topics Mstr `json:"topics,omitempty"` IP uint32 `json:"ipi,omitempty"` Plat int8 `json:"plat"` Device string `json:"device"` Version string `json:"version,omitempty"` CTime xtime.Time `json:"-"` MTime xtime.Time `json:"-"` // ats member info Members []*Info `json:"members"` }
Content ReplyContent
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
Cursor Cursor
type CursorParams ¶
type CursorParams struct { Mid int64 Oid int64 OTyp int8 Sort int8 HTMLEscape bool IP string RootID int64 Cursor *Cursor HotSize int ShowFolded bool }
CursorParams CursorParams
type DescFloors ¶
type DescFloors []int64
DescFloors floors sort.
func (DescFloors) Len ¶
func (f DescFloors) Len() int
func (DescFloors) Less ¶
func (f DescFloors) Less(i, j int) bool
func (DescFloors) Swap ¶
func (f DescFloors) Swap(i, j int)
type DialogCursor ¶
type DialogMeta ¶
type Emoji ¶
type Emoji struct { ID int64 `json:"id"` PackageID int64 `json:"-"` Name string `json:"name"` URL string `json:"url"` State int8 `json:"state"` Remark string `json:"remark"` }
Emoji Emoji
type EmojiPackage ¶
type EmojiPackage struct { ID int64 `json:"pid"` Name string `json:"pname"` State int8 `json:"pstate"` URL string `json:"purl"` Emojis []*Emoji `json:"emojis"` }
EmojiPackage EmojiPackage
type FansDetail ¶
type FansDetail struct { UID int64 `json:"uid"` MedalID int32 `json:"medal_id"` //勋章id MedalName string `json:"medal_name"` //勋章名称 Score int32 `json:"score"` //当前总经验值 Level int8 `json:"level"` //level等级 Intimacy int32 `json:"intimacy"` //当前亲密度 Status int8 `json:"master_status"` //佩戴状态1:佩戴中0:未佩戴 Received int8 `json:"is_receive"` //是否领取0:未领取1:已领取 }
FansDetail FansDetail
type Info ¶
type Info struct { Mid string `json:"mid"` Name string `json:"uname"` Sex string `json:"sex"` Sign string `json:"sign"` Avatar string `json:"avatar"` Rank string `json:"rank"` DisplayRank string `json:"DisplayRank"` LevelInfo struct { Cur int `json:"current_level"` Min int `json:"current_min"` NowExp int `json:"current_exp"` NextExp int `json:"next_exp"` } `json:"level_info"` Pendant accmdl.PendantInfo `json:"pendant"` Nameplate accmdl.NameplateInfo `json:"nameplate"` OfficialVerify struct { Type int `json:"type"` Desc string `json:"desc"` } `json:"official_verify"` Vip struct { Type int `json:"vipType"` DueDate int64 `json:"vipDueDate"` DueRemark string `json:"dueRemark"` AccessStatus int `json:"accessStatus"` VipStatus int `json:"vipStatus"` VipStatusWarn string `json:"vipStatusWarn"` } `json:"vip"` }
Info Info
type Int64Bytes ¶
type Int64Bytes []int64
Int64Bytes implements the Scanner interface.
func (Int64Bytes) Bytes ¶
func (is Int64Bytes) Bytes() []byte
Bytes marshal int64 slice to bytes,each int64 will occupy Fixed 8 bytes
func (*Int64Bytes) Evict ¶
func (is *Int64Bytes) Evict(e int64) (ok bool)
Evict get rid of the sepcified num from the slice
func (Int64Bytes) Exist ¶
func (is Int64Bytes) Exist(i int64) (e bool)
Exist judge the sepcified num is in the slice or not
func (*Int64Bytes) Scan ¶
func (is *Int64Bytes) Scan(src interface{}) (err error)
Scan parse the data into int64 slice
type Member ¶
type Member struct { *Info FansDetail *FansDetail `json:"fans_detail"` Following int16 `json:"following"` //是否关注 }
Member ReplyMember
type Notice ¶
type Notice struct { ID int64 `json:"id"` Plat int8 `json:"-"` Condition int8 `json:"-"` Build int64 `json:"-"` Title string `json:"title"` Content string `json:"content"` Link string `json:"link"` ClientType string `json:"-"` }
Notice Notice
type PageParams ¶
type PageParams struct { Mid int64 Oid int64 Type int8 Sort int8 PageNum int PageSize int NeedHot bool NeedSecond bool Escape bool }
PageParams reply page param.
type PageResult ¶
type PageResult struct { Subject *Subject TopAdmin *Reply TopUpper *Reply Roots []*Reply Hots []*Reply Total int AllCount int }
PageResult reply page result.
type Record ¶
type Record struct { RpID int64 `json:"id"` Oid int64 `json:"oid"` Type int32 `json:"type"` Floor int32 `json:"floor"` Like int32 `json:"like"` RCount int32 `json:"rcount"` Mid int64 `json:"mid"` State int32 `json:"state"` Message string `json:"message"` CTime string `json:"ctime"` Ats string `json:"ats,omitempty"` Members []*Info `json:"members"` }
Record reply record.
type Reply ¶
type Reply struct { RpID int64 `json:"rpid"` Oid int64 `json:"oid"` Type int8 `json:"type"` Mid int64 `json:"mid"` Root int64 `json:"root"` Parent int64 `json:"parent"` Dialog int64 `json:"dialog"` Count int `json:"count"` RCount int `json:"rcount"` Floor int `json:"floor,omitempty"` State int8 `json:"state"` FansGrade int8 `json:"fansgrade"` Attr uint32 `json:"attr"` CTime xtime.Time `json:"ctime"` MTime xtime.Time `json:"-"` // string RpIDStr string `json:"rpid_str,omitempty"` RootStr string `json:"root_str,omitempty"` ParentStr string `json:"parent_str,omitempty"` DialogStr string `json:"dialog_str",omitempty` // action count, from ReplyAction count Like int `json:"like"` Hate int `json:"-"` Action int8 `json:"action"` // member info Member *Member `json:"member"` // other Content *Content `json:"content"` Replies []*Reply `json:"replies"` Assist int `json:"assist"` // 是否有折叠评论 Folder Folder `json:"folder"` }
Reply Reply
type Report ¶
type Report struct { ID int64 `json:"id"` RpID int64 `json:"rpid"` Oid int64 `json:"oid"` Type int8 `json:"type"` Mid int64 `json:"mid"` Reason int8 `json:"reason"` Content string `json:"content"` Count int `json:"count"` Score int `json:"score"` State int8 `json:"state"` CTime xtime.Time `json:"ctime"` MTime xtime.Time `json:"-"` Attr int8 `json:"attr"` }
Report Report
type ReportUser ¶
type ReportUser struct { ID int64 `json:"id"` Oid int64 `json:"oid"` Type int8 `json:"type"` RpID int64 `json:"rpid"` Mid int64 `json:"mid"` Reason int8 `json:"reason"` Content string `json:"content"` State int8 `json:"state"` CTime xtime.Time `json:"ctime"` MTime xtime.Time `json:"mtime"` }
ReportUser report user.
type RootReplyList ¶
type RootReplyList struct { Subject *Subject Header *RootReplyListHeader TopAdmin *Reply TopUpper *Reply Hots []*Reply Roots []*Reply CursorRangeMax, CursorRangeMin int64 }
RootReplyList RootReplyList
type RootReplyListHeader ¶
RootReplyListHeader RootReplyListHeader
type Subject ¶
type Subject struct { ID int64 `json:"-"` Oid int64 `json:"oid"` Type int8 `json:"type"` Mid int64 `json:"mid"` Count int `json:"count"` RCount int `json:"rcount"` ACount int `json:"acount"` State int8 `json:"state"` Attr uint32 `json:"attr"` Meta string `json:"meta"` CTime xtime.Time `json:"ctime"` MTime xtime.Time `json:"-"` }
Subject ReplySubject
type SubjectMeta ¶
type SubjectMeta struct { AdminTop int64 `json:"atop,omitempty"` UpperTop int64 `json:"utop,omitempty"` }
SubjectMeta SubjectMeta