Documentation ¶
Index ¶
- Constants
- Variables
- func CoverURL(uri string) (cover string)
- func CoverURLHTTPS(uri string) (cover string)
- func FillPlayerURI(gt string, id int64, player string) (uri string)
- func FillRedirect(gt string, typ int) (redirect string)
- func FillSongTagURI(id int64) (uri string)
- func FillURI(gt, param string, typ int, plat int8, build int, f func(uri string) string) (uri string)
- func InvalidBuild(srcBuild, cfgBuild int, cfgCond string) bool
- func InvalidChannel(plat int8, srcCh, cfgCh string) bool
- func IsAndroid(plat int8) bool
- func IsGoto(gt string) bool
- func IsIOS(plat int8) bool
- func IsIPad(plat int8) bool
- func IsOverseas(plat int8) bool
- func Plat(mobiApp, device string) int8
Constants ¶
View Source
const ( // PlatAndroid is int8 for android. PlatAndroid = int8(0) // PlatIPhone is int8 for iphone. PlatIPhone = int8(1) // PlatIPad is int8 for ipad. PlatIPad = int8(2) // PlatWPhone is int8 for wphone. PlatWPhone = int8(3) // PlatAndroidG is int8 for Android Global. PlatAndroidG = int8(4) // PlatIPhoneI is int8 for Iphone Global. PlatIPhoneI = int8(5) // PlatIPadI is int8 for IPAD Global. PlatIPadI = int8(6) // PlatAndroidTV is int8 for AndroidTV Global. PlatAndroidTV = int8(7) // PlatAndroidI is int8 for Android Global. PlatAndroidI = int8(8) GotoAv = "av" GotoWeb = "web" GotoBangumi = "bangumi" GotoPGC = "pgc" GotoLive = "live" GotoGame = "game" GotoTopic = "topic" GotoActivity = "activity" GotoAdAv = "ad_av" GotoAdWeb = "ad_web" GotoRank = "rank" GotoTag = "tag" GotoBangumiRcmd = "bangumi_rcmd" GotoLogin = "login" GotoUpBangumi = "up_bangumi" GotoBanner = "banner" GotoAdWebS = "ad_web_s" GotoUpArticle = "up_article" GotoGameDownload = "game_download" GotoConverge = "converge" GotoSpecial = "special" GotoArticle = "article" GotoArticleS = "article_s" GotoGameDownloadS = "game_download_s" GotoShoppingS = "shopping_s" GotoAudio = "audio" GotoPlayer = "player" GotoAdLarge = "ad_large" GotoSpecialS = "special_s" GotoPlayerLive = "player_live" GotoSong = "song" GotoUpRcmdAv = "up_rcmd_av" GotoSubscribe = "subscribe" GotoLiveUpRcmd = "live_up_rcmd" GotoTopstick = "topstick" GotoChannelRcmd = "channel_rcmd" GotoPgcsRcmd = "pgcs_rcmd" GotoUpRcmdS = "up_rcmd_s" GotoPegasusTab = "pegasus" // audio tag GotoAudioTag = "audio_tag" // extra tab GotoTabBackground = "background" GotoTabEntrance = "entrance" GotoTabContentRcmd = "content_rcmd" GotoTabTagRcmd = "tag_rcmd" GotoTabSignIn = "sign_in" GotoTabNews = "news" // EnvPro is pro. EnvPro = "pro" // EnvTest is env. EnvTest = "test" // EnvDev is env. EnvDev = "dev" )
Variables ¶
View Source
var ( AvHandler = func(a *api.Arc) func(uri string) string { return func(uri string) string { if a == nil { return uri } if a.Dimension.Height != 0 || a.Dimension.Width != 0 { return fmt.Sprintf("%s?player_width=%d&player_height=%d&player_rotate=%d", uri, a.Dimension.Width, a.Dimension.Height, a.Dimension.Rotate) } return uri } } AvPlayHandler = func(a *archive.Archive3, ap *archive.PlayerInfo) func(uri string) string { var player string if ap != nil { bs, _ := json.Marshal(ap) player = url.QueryEscape(string(bs)) if strings.IndexByte(player, '+') > -1 { player = strings.Replace(player, "+", "%20", -1) } } return func(uri string) string { if player != "" && (a.Dimension.Height != 0 || a.Dimension.Width != 0) { return fmt.Sprintf("%s?page=1&player_preload=%s&player_width=%d&player_height=%d&player_rotate=%d", uri, player, a.Dimension.Width, a.Dimension.Height, a.Dimension.Rotate) } else if player != "" { return fmt.Sprintf("%s?page=1&player_preload=%s", uri, player) } else if a.Dimension.Height != 0 || a.Dimension.Width != 0 { return fmt.Sprintf("%s?player_width=%d&player_height=%d&player_rotate=%d", uri, a.Dimension.Width, a.Dimension.Height, a.Dimension.Rotate) } return uri } } LiveUpHandler = func(l *cardlive.Card) func(uri string) string { return func(uri string) string { if l == nil { return uri } return fmt.Sprintf("%s?broadcast_type=%d", uri, l.BroadcastType) } } LiveRoomHandler = func(l *cardlive.Room) func(uri string) string { return func(uri string) string { if l == nil { return uri } return fmt.Sprintf("%s?broadcast_type=%d", uri, l.BroadcastType) } } PegasusHandler = func(m *tab.Menu) func(uri string) string { return func(uri string) string { if m == nil { return uri } if m.Title != "" { return fmt.Sprintf("%s?name=%s", uri, url.QueryEscape(m.Title)) } return uri } } )
Functions ¶
func CoverURLHTTPS ¶
func FillPlayerURI ¶
FillPlayerURI deal app schema.
func FillRedirect ¶
func FillSongTagURI ¶
func FillURI ¶
func FillURI(gt, param string, typ int, plat int8, build int, f func(uri string) string) (uri string)
FillURI deal app schema.
func InvalidBuild ¶
InvalidBuild check source build is not allow by config build and condition. eg: when condition is gt, means srcBuild must gt cfgBuild, otherwise is invalid srcBuild.
func InvalidChannel ¶
InvalidChannel check source channel is not allow by config channel.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.