barrage

package
v0.0.0-...-d608710 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MESSAGE_NOTICE = "ws://openapi.huya.com/index.html?do=getMessageNotice&data={}&appId={}&timestamp={}&sign={}"
	ITEM_NOTICE    = "ws://openapi.huya.com/index.html?do=getSendItemNotice&data={}&appId={}&timestamp={}&sign={}"
	VIP_NOTICE     = "ws://openapi.huya.com/index.html?do=getVipEnterBannerNotice&data={}&appId={}&timestamp={}&sign={}"
)

Variables

View Source
var C = make(chan int)

Functions

func ConnectItemMessage

func ConnectItemMessage(c Client, callback func(message *ItemNotice))

func ConnectMessage

func ConnectMessage(c Client, callback func(message *MessageNotice))

func ConnectVipMessage

func ConnectVipMessage(c Client, callback func(message *VipNotice))

func GetTimestampUnixString

func GetTimestampUnixString() string

func Md5String

func Md5String(s string) string

func Sync

func Sync()

func ToStruct

func ToStruct(call, obj interface{}) error

Types

type Client

type Client struct {
	RoomId string
	AppId  string
	Key    string
}

func (Client) Connect

func (c Client) Connect(url string, call func(call interface{}))

type ItemNotice

type ItemNotice struct {
	ItemName          string `json:"itemName"`
	PresenterNick     string `json:"presenterNick"`
	RoomId            int    `json:"roomId"`
	SendItemComboHits int    `json:"sendItemComboHits"`
	SendItemCount     int    `json:"sendItemCount"`
	SendNick          string `json:"sendNick"`
	SenderAvatarurl   string `json:"senderAvatarurl"`
}

type MessageNotice

type MessageNotice struct {
	BadgeName       string `json:"badgeName"`
	Content         string `json:"content"`
	FansLevel       int    `json:"fansLevel"`
	NobleLevel      int    `json:"nobleLevel"`
	Roomid          int    `json:"roomid"`
	SendNick        string `json:"sendNick"`
	SenderAvatarUrl string `json:"senderAvatarUrl"`
	SenderGender    int    `json:"senderGender"`
	ShowMode        int    `json:"showMode"`
}

type ResponseData

type ResponseData struct {
	StatusCode int `json:"statusCode"`

	StatusMsg string `json:"statusMsg"`

	Data interface{} `json:"data"`
}

type VipNotice

type VipNotice struct {
	BadgeName     string `json:"badgeName"`
	FansLevel     int    `json:"fansLevel"`
	NobleLevel    int    `json:"nobleLevel"`
	NobleName     string `json:"nobleName"`
	RoomId        int    `json:"roomId"`
	UserAvatarUrl string `json:"userAvatarUrl"`
	UserNick      string `json:"userNick"`
	WeekRank      int    `json:"weekRank"`
	GuardLevel    int    `json:"guardLevel"`
}

Jump to

Keyboard shortcuts

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