datadao

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

Documentation

Index

Constants

View Source
const (
	APIMcnSummary          = "http://berserker.bilibili.co/avenger/api/155/query" // 7   see doc http://info.bilibili.co/pages/viewpage.action?pageId=11545690
	APIIndexInc            = "http://berserker.bilibili.co/avenger/api/156/query" // 3.1
	APIIndexSource         = "http://berserker.bilibili.co/avenger/api/159/query" // 3.2
	APIPlaySource          = "http://berserker.bilibili.co/avenger/api/161/query" // 3.3
	APIMcnFans             = "http://berserker.bilibili.co/avenger/api/168/query" // 3.4
	APIMcnFansInc          = "http://berserker.bilibili.co/avenger/api/171/query" // 3.5
	APIMcnFansDec          = "http://berserker.bilibili.co/avenger/api/169/query" // 3.6
	APIMcnFansAttentionWay = "http://berserker.bilibili.co/avenger/api/170/query" // 3.7
	APIMcnFansSex          = "http://berserker.bilibili.co/avenger/api/162/query" // 3.8
	APIMcnFansAge          = "http://berserker.bilibili.co/avenger/api/163/query" // 3.8
	APIMcnFansPlayWay      = "http://berserker.bilibili.co/avenger/api/164/query" // 3.8
	APIMcnFansArea         = "http://berserker.bilibili.co/avenger/api/165/query" // 3.9
	APIMcnFansType         = "http://berserker.bilibili.co/avenger/api/166/query" // 3.10
	APIMcnFansTag          = "http://berserker.bilibili.co/avenger/api/167/query" // 3.11
)

const url for api

Variables

This section is empty.

Functions

func NewCacheMcnDataSignID

func NewCacheMcnDataSignID(signID int64, date time.Time, val interface{}, desc string, loadFunc LoadFuncOnlySign) *cacheMcnDataSignID

NewCacheMcnDataSignID 请求只有sign id的情况

func NewCacheMcnDataWithTp

func NewCacheMcnDataWithTp(signID int64, date time.Time, tp string, val interface{}, desc string, loadFunc LoadFuncWithTp) *cacheMcnDataWithTp

NewCacheMcnDataWithTp reply

Types

type CacheBaseLoader

type CacheBaseLoader struct {
	SignID int64
	Date   time.Time
	Val    interface{}
	// contains filtered or unexported fields
}

CacheBaseLoader base loader

func (*CacheBaseLoader) Desc

func (s *CacheBaseLoader) Desc() string

Desc key desc

func (*CacheBaseLoader) Expire

func (s *CacheBaseLoader) Expire() time.Duration

Expire expiration

func (*CacheBaseLoader) Key

func (s *CacheBaseLoader) Key() (key string)

Key cache's key

func (*CacheBaseLoader) LoadValue

func (s *CacheBaseLoader) LoadValue(c context.Context) (value interface{}, err error)

LoadValue need load value

func (*CacheBaseLoader) Value

func (s *CacheBaseLoader) Value() (value interface{})

Value cache's value

type Dao

type Dao struct {
	Client *datacenter.HttpClient
	Conf   *conf.Config

	McWrapper *cache.MCWrapper
	// contains filtered or unexported fields
}

Dao data dao

func New

func New(c *conf.Config) *Dao

New .

func (*Dao) GetFansArea

func (d *Dao) GetFansArea(c context.Context, signID int64, date time.Time, tp string) (res *mcnmodel.McnGetFansAreaReply, err error)

GetFansArea 3.9 see doc http://info.bilibili.co/pages/viewpage.action?pageId=11545690#id-对外接口文档-3.9.查询MCN粉丝/游客地区分布分析

func (*Dao) GetFansAreaCache

func (d *Dao) GetFansAreaCache(c context.Context, signID int64, date time.Time, tp string) (res *mcnmodel.McnGetFansAreaReply, err error)

GetFansAreaCache GetFansArea with cache

func (*Dao) GetFansBaseFansAttr

func (d *Dao) GetFansBaseFansAttr(c context.Context, signID int64, date time.Time, tp string) (res *mcnmodel.McnGetBaseFansAttrReply, err error)

GetFansBaseFansAttr 3.8 see doc http://info.bilibili.co/pages/viewpage.action?pageId=11545690#id-对外接口文档-3.8.查询MCN粉丝/游客基本属性分析(性别占比 观众年龄 观看途径)

func (*Dao) GetFansBaseFansAttrCache

func (d *Dao) GetFansBaseFansAttrCache(c context.Context, signID int64, date time.Time, tp string) (res *mcnmodel.McnGetBaseFansAttrReply, err error)

GetFansBaseFansAttrCache GetFansBaseFansAttr with cache

func (*Dao) GetFansTag

func (d *Dao) GetFansTag(c context.Context, signID int64, date time.Time, tp string) (res *mcnmodel.McnGetFansTagReply, err error)

GetFansTag 3.11 see doc http://info.bilibili.co/pages/viewpage.action?pageId=11545690#id-对外接口文档-3.11.查询MCN粉丝/游客标签地图分析

func (*Dao) GetFansTagCache

func (d *Dao) GetFansTagCache(c context.Context, signID int64, date time.Time, tp string) (res *mcnmodel.McnGetFansTagReply, err error)

GetFansTagCache GetFansTag with cache

func (*Dao) GetFansType

func (d *Dao) GetFansType(c context.Context, signID int64, date time.Time, tp string) (res *mcnmodel.McnGetFansTypeReply, err error)

GetFansType 3.10 see doc http://info.bilibili.co/pages/viewpage.action?pageId=11545690#id-对外接口文档-3.10.查询MCN粉丝/游客内容倾向分析

func (*Dao) GetFansTypeCache

func (d *Dao) GetFansTypeCache(c context.Context, signID int64, date time.Time, tp string) (res *mcnmodel.McnGetFansTypeReply, err error)

GetFansTypeCache GetFansType with cache

func (*Dao) GetIndexInc

func (d *Dao) GetIndexInc(c context.Context, signID int64, date time.Time, tp string) (res *mcnmodel.McnGetIndexIncReply, err error)

GetIndexInc 3.1 see doc http://info.bilibili.co/pages/viewpage.action?pageId=11545690#id-对外接口文档-3.1.查询MCN增量趋势

func (*Dao) GetIndexIncCache

func (d *Dao) GetIndexIncCache(c context.Context, signID int64, date time.Time, tp string) (res *mcnmodel.McnGetIndexIncReply, err error)

GetIndexIncCache GetIndexInc with cache

func (*Dao) GetIndexSource

func (d *Dao) GetIndexSource(c context.Context, signID int64, date time.Time, tp string) (res *mcnmodel.McnGetIndexSourceReply, err error)

GetIndexSource 3.2 see doc http://info.bilibili.co/pages/viewpage.action?pageId=11545690#id-对外接口文档-3.2.查询MCN下播放稿件来源所在分区

func (*Dao) GetIndexSourceCache

func (d *Dao) GetIndexSourceCache(c context.Context, signID int64, date time.Time, tp string) (res *mcnmodel.McnGetIndexSourceReply, err error)

GetIndexSourceCache GetIndexSource with cache

func (*Dao) GetMcnFans

func (d *Dao) GetMcnFans(c context.Context, signID int64, date time.Time) (res *mcnmodel.McnGetMcnFansReply, err error)

GetMcnFans 3.4 see doc http://info.bilibili.co/pages/viewpage.action?pageId=11545690#id-对外接口文档-3.4.查询MCN粉丝数与活跃度

func (*Dao) GetMcnFansAttentionWay

func (d *Dao) GetMcnFansAttentionWay(c context.Context, signID int64, date time.Time) (res *mcnmodel.McnGetMcnFansAttentionWayReply, err error)

GetMcnFansAttentionWay 3.7 see doc http://info.bilibili.co/pages/viewpage.action?pageId=11545690#id-对外接口文档-3.7.查询MCN粉丝关注渠道

func (*Dao) GetMcnFansAttentionWayCache

func (d *Dao) GetMcnFansAttentionWayCache(c context.Context, signID int64, date time.Time) (res *mcnmodel.McnGetMcnFansAttentionWayReply, err error)

GetMcnFansAttentionWayCache GetMcnFansAttentionWay with cache

func (*Dao) GetMcnFansCache

func (d *Dao) GetMcnFansCache(c context.Context, signID int64, date time.Time) (res *mcnmodel.McnGetMcnFansReply, err error)

GetMcnFansCache GetMcnFans with cache

func (*Dao) GetMcnFansDec

func (d *Dao) GetMcnFansDec(c context.Context, signID int64, date time.Time) (res *mcnmodel.McnGetMcnFansDecReply, err error)

GetMcnFansDec 3.6 see doc http://info.bilibili.co/pages/viewpage.action?pageId=11545690#id-对外接口文档-3.6.查询MCN粉丝取关数按天

func (*Dao) GetMcnFansDecCache

func (d *Dao) GetMcnFansDecCache(c context.Context, signID int64, date time.Time) (res *mcnmodel.McnGetMcnFansDecReply, err error)

GetMcnFansDecCache GetMcnFansDec with cache

func (*Dao) GetMcnFansInc

func (d *Dao) GetMcnFansInc(c context.Context, signID int64, date time.Time) (res *mcnmodel.McnGetMcnFansIncReply, err error)

GetMcnFansInc 3.5 see doc http://info.bilibili.co/pages/viewpage.action?pageId=11545690#id-对外接口文档-3.5.查询MCN粉丝按天增量

func (*Dao) GetMcnFansIncCache

func (d *Dao) GetMcnFansIncCache(c context.Context, signID int64, date time.Time) (res *mcnmodel.McnGetMcnFansIncReply, err error)

GetMcnFansIncCache GetMcnFansInc with cache

func (*Dao) GetMcnSummary

func (d *Dao) GetMcnSummary(c context.Context, signID int64, date time.Time) (res *mcnmodel.McnGetDataSummaryReply, err error)

GetMcnSummary 7 see doc http://info.bilibili.co/pages/viewpage.action?pageId=11545690#id-对外接口文档-7.mcn获取概要数据

func (*Dao) GetMcnSummaryCache

func (d *Dao) GetMcnSummaryCache(c context.Context, signID int64, date time.Time) (res *mcnmodel.McnGetDataSummaryReply, err error)

GetMcnSummaryCache GetMcnSummary with cache

func (*Dao) GetPlaySource

func (d *Dao) GetPlaySource(c context.Context, signID int64, date time.Time) (res *mcnmodel.McnGetPlaySourceReply, err error)

GetPlaySource 3.3 see doc http://info.bilibili.co/pages/viewpage.action?pageId=11545690#id-对外接口文档-3.3.查询MCN播放设备占比

func (*Dao) GetPlaySourceCache

func (d *Dao) GetPlaySourceCache(c context.Context, signID int64, date time.Time) (res *mcnmodel.McnGetPlaySourceReply, err error)

GetPlaySourceCache GetPlaySource with cache

func (*Dao) HTTPDataHandle

func (d *Dao) HTTPDataHandle(c context.Context, params url.Values, key string) (data interface{}, err error)

HTTPDataHandle .

type LoadFuncOnlySign

type LoadFuncOnlySign func(c context.Context, signID int64, date time.Time) (res interface{}, err error)

LoadFuncOnlySign only sign

type LoadFuncWithTp

type LoadFuncWithTp func(c context.Context, signID int64, date time.Time, tp string) (res interface{}, err error)

LoadFuncWithTp sign with type

Jump to

Keyboard shortcuts

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