dao

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	//InfocDMSend 弹幕发送成功上报
	InfocDMSend *infoc.Infoc
	//InfocDMErr 弹幕发送失败上报
	InfocDMErr *infoc.Infoc
)
View Source
var (

	//FilterClient 屏蔽词过滤
	FilterClient filterService.FilterClient
	//LcClient 地理区域信息
	LcClient locationService.LocationClient
	//SpyClient 用户真实分
	SpyClient spyService.SpyClient
	//BcastClient  弹幕推送
	BcastClient *broadcasrtService.Client
)
View Source
var (
	//IP4db ip4地址库
	IP4db *ipdb.City
	//IP6db ip6地址库
	IP6db *ipdb.City
)
View Source
var (
	// BannedServiceClient liveRpc banner_service api
	BannedServiceClient *bannedService.Client
	// RoomServiceClient liveRpc room service api
	RoomServiceClient *roomService.Client
	// LiveUserServiceClient liveRpc liveUser service api
	LiveUserServiceClient *liveUserService.Client
	// AvServiceClient  liveRpc av service api
	AvServiceClient *avService.Client
	//FansMedalServiceClient liverpc fansmedal service api
	FansMedalServiceClient *fansMedalService.Client
	//ActivityServiceClient liverpc  activity service api
	ActivityServiceClient *activityService.Client
	//RcServiceClient liverpc rc service api
	RcServiceClient *rcService.Client
	//RankdbServiceClient liverpc rankdb service api
	RankdbServiceClient *rankdbService.Client
	//UserExtServiceClient liverpc userext service api
	UserExtServiceClient *userextService.Client
	//LiveBroadCastClient liverpc thirdApi
	LiveBroadCastClient *liveBroadCast.Client
)

Functions

func IncrDMNum

func IncrDMNum(ctx context.Context, rid int64, mode int64)

IncrDMNum 弹幕条数

func InitAPI

func InitAPI()

InitAPI init all service APIS

func InitDatabus

func InitDatabus(c *conf.Config)

InitDatabus 初始化databus

func InitGrpc

func InitGrpc(c *conf.Config)

InitGrpc 初始化grpcclient

func InitIPdb

func InitIPdb()

InitIPdb 初始化IPdb

func InitLancer

func InitLancer(c *conf.Config)

InitLancer 初始化lancer上报

func InitTitan

func InitTitan()

InitTitan 初始化kv配置

func SendBNDatabus

func SendBNDatabus(ctx context.Context, uid int64, info *model.BNDatabus)

SendBNDatabus 拜年祭制定房间投递到databus

func SendBroadCast

func SendBroadCast(ctx context.Context, sm string, rid int64) error

SendBroadCast 发送弹幕(http)

func SendBroadCastGrpc

func SendBroadCastGrpc(ctx context.Context, sm string, rid int64) error

SendBroadCastGrpc 调用GRPC发送弹幕

Types

type CommentTitle

type CommentTitle struct {
	OldTitle string `json:"oldtitle"`
	Title    string `json:"title"`
}

CommentTitle 头衔信息

func (*CommentTitle) GetCommentTitle

func (c *CommentTitle) GetCommentTitle(ctx context.Context) error

GetCommentTitle 获取头衔

type DMConf

type DMConf struct {
	Mode   int64
	Color  int64
	Length int64
}

DMConf 弹幕配置

func (*DMConf) Get

func (d *DMConf) Get(ctx context.Context, uid int64, roomid int64, c *conf.Config) error

Get 获取用户的弹幕配置信息

type Dao

type Dao struct {
	Databus *fanout.Fanout
	// contains filtered or unexported fields
}

Dao dao

func New

func New(c *conf.Config) (dao *Dao)

New init mysql db

func (*Dao) Close

func (d *Dao) Close()

Close close the resource.

func (*Dao) GetHistoryData

func (d *Dao) GetHistoryData(ctx context.Context, roomid int64) (result map[string][]string, err error)

GetHistoryData 获取历史数据

func (*Dao) IsWhietListUID

func (d *Dao) IsWhietListUID(ctx context.Context, key string) (isWhite bool)

IsWhietListUID 通过UID判读是否是白名单用户

func (*Dao) Ping

func (d *Dao) Ping(c context.Context) error

Ping dao ping

func (*Dao) SaveHistory

func (d *Dao) SaveHistory(ctx context.Context, hm string, adm bool, rid int64)

SaveHistory 弹幕历史存入redis

type FansMedalInfo

type FansMedalInfo struct {
	MedalID      int64
	RUID         int64
	RUName       string
	MedalLevel   int64
	MedalName    string
	AnchorName   string
	RoomID       int64
	MColor       int64
	SpecialMedal string
	// contains filtered or unexported fields
}

FansMedalInfo 粉丝勋章信息

func (*FansMedalInfo) GetFansMedal

func (f *FansMedalInfo) GetFansMedal(ctx context.Context, uid int64) error

GetFansMedal 获取主播的粉丝勋章信息

func (*FansMedalInfo) GetMedalRoomid

func (f *FansMedalInfo) GetMedalRoomid(ctx context.Context, uid int64) error

GetMedalRoomid 获取勋章对应主播的房间

func (*FansMedalInfo) GetMedalanchorName

func (f *FansMedalInfo) GetMedalanchorName(ctx context.Context, uid int64) error

GetMedalanchorName 获取勋章对应主播的昵称

func (*FansMedalInfo) GetSpeicalMedal

func (f *FansMedalInfo) GetSpeicalMedal(ctx context.Context, uid int64, rid int64) error

GetSpeicalMedal 获取特殊勋章

type LimitCheckInfo

type LimitCheckInfo struct {
	UID     int64
	RoomID  int64
	Msg     string
	MsgType int64
	Dao     *Dao
	Conf    *LimitConf
}

LimitCheckInfo 频率限制检查参数

func (*LimitCheckInfo) LimitPerSec

func (l *LimitCheckInfo) LimitPerSec(ctx context.Context) error

LimitPerSec 每秒发言限制

func (*LimitCheckInfo) LimitRoomPerSecond

func (l *LimitCheckInfo) LimitRoomPerSecond(ctx context.Context) error

LimitRoomPerSecond 单房间每秒只能发送制定条数弹幕

func (*LimitCheckInfo) LimitSameMsg

func (l *LimitCheckInfo) LimitSameMsg(ctx context.Context) error

LimitSameMsg 同一个用户同一房间5s 只能发送一条相同弹幕

type LimitConf

type LimitConf struct {
	AreaLimit        bool   `json:"areaLimit"`
	AllUserLimit     bool   `json:"AllUserLimit"`
	LevelLimitStatus bool   `json:"LevelLimitStatus"`
	LevelLimit       int64  `json:"LevelLimit"`
	RealName         bool   `json:"RealName"`
	PhoneLimit       bool   `json:"PhoneLimit"`
	MsgLength        int    `json:"MsgLength"`
	DmNum            int64  `json:"DmNum"`
	DMPercent        int64  `json:"DMPercent"`
	DMwhitelist      bool   `json:"DMwhitelist"`
	DMwhitelistID    string `json:"DMwhitelistID"`
}

LimitConf 弹幕限制配置

func (*LimitConf) GetDMCheckConf

func (l *LimitConf) GetDMCheckConf()

GetDMCheckConf 获取弹幕配置参数

type RoomConf

type RoomConf struct {
	UID        int64
	RoomShield int64
	RoomID     int64
	Anchor     string
}

RoomConf 播主房间配置信息

func (*RoomConf) Get

func (r *RoomConf) Get(ctx context.Context, roomID int64) error

Get 获取主播房间配置信息s

type UserBindInfo

type UserBindInfo struct {
	Identification int32
	MobileVerify   int32
	Uname          string
	URank          int32
}

UserBindInfo 用户手机,实名等信息

func (*UserBindInfo) Get

func (u *UserBindInfo) Get(ctx context.Context, uid int64) error

Get 获取用户绑定信息,实名认知,绑定手机等信息

type UserInfo

type UserInfo struct {
	Vip           int
	Svip          int
	UserLever     int64
	UserScore     int64
	ULevelRank    int64
	ULevelColor   int64
	UnameColor    string
	RoomAdmin     bool
	PrivilegeType int
	Bubble        int64
	MedalInfo     *FansMedalInfo
	// contains filtered or unexported fields
}

UserInfo 用户等级,经验等信息

func (*UserInfo) Get

func (u *UserInfo) Get(ctx context.Context, uid int64) error

Get 获取用户等级,经验等信息

func (*UserInfo) GetPrivilegeType

func (u *UserInfo) GetPrivilegeType(ctx context.Context, uid int64, ruid int64) error

GetPrivilegeType 获取大航海信息

func (*UserInfo) GetUnameColor

func (u *UserInfo) GetUnameColor(ctx context.Context, uid int64, rid int64) error

GetUnameColor 获取用户的昵称颜色

func (*UserInfo) GetUserBubble

func (u *UserInfo) GetUserBubble(ctx context.Context, uid int64, roomid int64, bubble int64, guardLevel int) error

GetUserBubble 判断用户是否有气泡

func (*UserInfo) GetUserLevelRank

func (u *UserInfo) GetUserLevelRank(ctx context.Context, uid int64) error

GetUserLevelRank 获取用户等级RANK

func (*UserInfo) GetVipInfo

func (u *UserInfo) GetVipInfo(ctx context.Context, uid int64) error

GetVipInfo 获取用户的老爷等级

func (*UserInfo) IsRoomAdmin

func (u *UserInfo) IsRoomAdmin(ctx context.Context, uid int64, roomid int64) error

IsRoomAdmin 判断用户是否是房管

type UserScore

type UserScore struct {
	UserScore int64
	MsgAI     int64
	MsgLevel  int64
	// contains filtered or unexported fields
}

UserScore 用户真实分已经弹幕ai分

func (*UserScore) GetMsgScore

func (u *UserScore) GetMsgScore(ctx context.Context, msg string) error

GetMsgScore 获取弹幕AI分

func (*UserScore) GetUserScore

func (u *UserScore) GetUserScore(ctx context.Context, uid int64) error

GetUserScore 用户真实分

Jump to

Keyboard shortcuts

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