conf

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Conf = &Config{}
)

Conf global variable.

Functions

func Init

func Init() (err error)

Init init conf.

Types

type App

type App struct {
	*bm.App
}

App config

type AuditSign

type AuditSign struct {
	Key    string
	Secret string
}

AuditSign cfg is used to check license owner requests

type AuthMsg

type AuthMsg struct {
	PGCOffline    string // offline pgc
	CMSInvalid    string // cms not valid
	LicenseReject string // license owner rejected
}

AuthMsg configures the auth error messages

type Cfg

type Cfg struct {
	ZonePs          int                // Zone index page size
	AuthMsg         *AuthMsg           // auth error message config
	ZonesInfo       *ZonesInfo         // all the zones info
	Dangbei         *Dangbei           // dangbei configuration
	PageReload      xtime.Duration     // all page reload duration
	IndexShowReload xtime.Duration     // index show reload duration
	EsIntervReload  xtime.Duration     // es intervention reload duration
	DefaultSplash   string             // default splash url
	FavPs           int                // favorite cfg
	PGCFilterBuild  int                // the build number, under which we export only pgc modules and data
	VipQns          []string           // the qualities dedicated for vips
	HisCfg          *HisCfg            // history related cfg
	EsIdx           *EsIdx             // elastic search index page cfg
	IndexLabel      *IndexLabel        // index label cfg
	EmptyArc        *EmptyArc          // chan size
	VipMark         *VipMark           // vip mark
	SnVipCorner     *model.SnVipCorner // season vip corner mark cfg
	AuditSign       *AuditSign
}

Cfg def.

type Config

type Config struct {
	// zone configure
	Newzone map[string]*PageCfg
	// log
	Log *log.Config
	// tracer
	Tracer *trace.Config
	// http server config
	HTTPServer *bm.ServerConfig
	// auth
	Auth *auth.Config
	// verify
	Verify *verify.Config
	// mysql
	Mysql *sql.Config
	// memcache
	Memcache *Memcache
	// app
	TVApp *TVApp
	// homepage settings
	Homepage *PageConf
	// HTTPClient .
	HTTPClient    *bm.ClientConfig
	PlayurlClient *bm.ClientConfig
	SearchClient  *bm.ClientConfig
	// Redis
	Redis *Redis
	// Cfg common configuration
	Cfg *Cfg
	// Search Config
	Search *Search
	// RPC config
	ArcClient   *warden.ClientConfig
	AccClient   *warden.ClientConfig
	HisRPC      *rpc.ClientConfig
	FavoriteRPC *rpc.ClientConfig
	TvVipClient *warden.ClientConfig
	// Ip Whitelist
	IP *IP
	// ecode
	Ecode *ecode.Config
	// api url
	Host   *Host
	Region *Region
	Style  *Style
	Wild   *Wild
}

Config struct of conf.

type Dangbei

type Dangbei struct {
	Pagesize int64          // dangbei api page size
	MangoPS  int            // mango page size
	Expire   xtime.Duration // dangbei page ID expiration
}

Dangbei cfg def.

type EmptyArc

type EmptyArc struct {
	ChanSize   int64
	UnshelvePS int
}

EmptyArc def.

type EsCfg

type EsCfg struct {
	Business string
	Index    string
}

EsCfg def.

type EsIdx

type EsIdx struct {
	UgcIdx, PgcIdx *EsCfg
}

EsIdx def.

type HisCfg

type HisCfg struct {
	Businesses []string
	Pagesize   int
}

HisCfg def.

type Host

type Host struct {
	Data        string // data.bilibili.co
	APIIndex    string // homepage pgc data source
	APIZone     string // zonepage pgc data source
	APIFollow   string // pgc follow
	APIMedia    string // pgc media detail
	APIMediaV2  string // pgc media detail v2
	APIRecom    string // pgc recom
	APINewindex string // pgc index_show
	UgcPlayURL  string // ugc play url
	AIUgcType   string // ai ugc type data
	APICo       string
	FavAdd      string // favorite add url
	FavDel      string // favorite del url
	ReqURL      string // version update request url
	ESHost      string // manager url
}

Host api urls

type IP

type IP struct {
	White *IPWhite
}

IP .

type IPWhite

type IPWhite struct {
	TvVip []string
}

IPWhite .

type IndexLabel

type IndexLabel struct {
	Fre       xtime.Duration
	PGCOrder  []string             // pgc order
	UGCOrder  []string             // ugc order
	YearV     map[string]*YearVDur // year value pair
	YearParam []string             // year params = pub_date, year
}

IndexLabel def.

func (*IndexLabel) IsYear

func (u *IndexLabel) IsYear(param string) bool

IsYear distinguishes whether the param is year type param

type Memcache

type Memcache struct {
	*memcache.Config
	RelateExpire xtime.Duration
	ViewExpire   xtime.Duration
	ArcExpire    xtime.Duration
	CmsExpire    xtime.Duration
	HisExpire    xtime.Duration
	MangoExpire  xtime.Duration
}

Memcache config

type PageCfg

type PageCfg struct {
	Name    string // page name
	Top     int    // recom positions
	Middle  int    // last updated
	Bottom  int    // bottom list
	TopM    int    // top interv module id
	MiddleM int    // middle interv module id
}

PageCfg cfg

type PageConf

type PageConf struct {
	FollowSize    int
	HideIndexShow []string // the zones that we need to hide the index show part
}

PageConf defines the configuration for the home page info

type Redis

type Redis struct {
	*redis.Config
	Expire xtime.Duration
}

Redis redis

type Region

type Region struct {
	StopSpan xtime.Duration // get region time span
}

Region .

type Search struct {
	URL         string
	MainVer     string
	SugNum      int
	SugPGCBuild int
	SugType     string
	Highlight   string         // use highlight or not
	HotwordFre  xtime.Duration // hotword reload frequency
	ResultURL   string
	UserSearch  string
}

Search related config def.

type Style

type Style struct {
	LabelSpan xtime.Duration
}

Style label .

type TVApp

type TVApp struct {
	MobiApp  string
	Build    string
	Platform string
}

TVApp defines the configuration on behalf of the tv app

type TvVip

type TvVip struct {
	Build int64
	Msg   string
}

TvVip def.

type VipMark

type VipMark struct {
	V1HideChargeable bool // whether we hide chargeable episode in pgc view V1
	EpFree           int  // ep's pay status which means free
	EP               *model.CornerMark
	LoadepMsg        *TvVip // tv vip cfg
}

VipMark def.

type Wild

type Wild struct {
	WildSearch *WildSearch
}

Wild .

type WildSearch

type WildSearch struct {
	UserNum        int
	UserVideoLimit int
	BiliUserNum    int
	BiliUserVl     int
	SeasonNum      int
	MovieNum       int
	SeasonMore     int
	MovieMore      int
}

WildSearch wild search .

type YearVDur

type YearVDur struct {
	Dur string `json:"dur"`
}

YearVDur def

type ZonesInfo

type ZonesInfo struct {
	PGCZonesID    []int          // all the zones' ID that need to be loaded
	UGCZonesID    []int16        // all the ugc zones' ID
	PageIDs       []int          // all the page ID's
	ZonesName     []string       // all the zones' name that need to be loaded
	TargetTypes   []int32        // ugc types that we could pick source data
	UgcTypes      []int32        // ugc archive type order, for search types listing
	OldIdxJump    int            // when the module is UGC and we can't find the old index page corresponding, we tell the client to jump to this category's index page
	OldIdxMapping map[string]int // ugc idx ID old and new mapping
}

ZonesInfo loads all the zones' ID and name

Jump to

Keyboard shortcuts

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