compose

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package compose 编排需要多次调用上游才能完成的用例。

读取步骤经 engine.Execute 执行,使用 AuthOptional 接收调用方 Cookie,不借用会话池。 扫码登录经 RawDoWithCookieAndInput 取得 Set-Cookie,确认后按需补查账号资料。 gRPC service、CLI 与其它前端都调这里,不得各自再拼一遍。

Index

Constants

View Source
const MaxPageSize = songendpoint.MaxDetails

MaxPageSize 是单页上限,超过时按上限返回。批量歌曲详情一次最多 1000 首, 用户歌单的上游单页也按这个数取。

Variables

This section is empty.

Functions

func CheckQrcode added in v0.5.3

CheckQrcode 轮询二维码状态;确认后返回新登录的凭据与账号,资料缺失时用新凭据补查。

状态与 803 体的账号提取在 authendpoint.CheckQrcode 的 MapResponse(宽容解码), 这里只做「确认后补全凭据」的组合:Set-Cookie 必须存在;账号资料缺失时用本次 登录的新凭据补查,不能沿用调用方的旧账号。

func PlaylistTracks

func PlaylistTracks(ctx context.Context, eng *engine.Engine, req *mmpb.AllTracksRequest) (*mmpb.AllTracksResponse, error)

PlaylistTracks 按歌单原顺序分页返回歌曲(对外的 AllTracks)。

歌单详情内嵌的 tracks 会被上游截断,只有 trackIds 完整:先取完整 trackIds, 切出这一页,再批量查这一页的歌曲详情。total 是歌单的歌曲总数; offset 超出总数时返回空页,不再请求歌曲详情。

func UserPlaylists

UserPlaylists 返回用户歌单的一页(对外的 UserPlaylist)。

上游分页不能直接透传:第一页会在 limit 之外额外插入「喜欢的音乐」,不返回总数, 创建 / 收藏的筛选也只能在拿到数据后做(先分页再筛选会得到短页、漏项)。所以按上游 单页上限取全量,再筛选、分页;total 是筛选后的总数,不随 limit / offset 变化。 「喜欢的音乐」的创建者就是用户本人,计入 ALL 与 CREATED。

Types

This section is empty.

Jump to

Keyboard shortcuts

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