Documentation
¶
Index ¶
- Constants
- Variables
- func ParseUID(raw string) (int64, error)
- func SearchQuickDateRange(value string, now time.Time) (startDate, endDate string, ok bool)
- type AccountBundleImportResult
- type AccountCheckRequest
- type AccountExportRequest
- type AccountExportResult
- type AccountImportRequest
- type AccountImportResult
- type AccountListResult
- type AccountPoolExecutor
- type AccountPoolStateStore
- type AccountRefreshRequest
- type AccountResult
- type AccountService
- func (s AccountService) Check(ctx context.Context, userID int64) (AccountResult, error)
- func (s AccountService) CheckWithRequest(ctx context.Context, request AccountCheckRequest) (AccountResult, error)
- func (s AccountService) Export(request AccountExportRequest) (AccountExportResult, error)
- func (s AccountService) Import(ctx context.Context, request AccountImportRequest) (AccountImportResult, error)
- func (s AccountService) ImportBundle(body []byte) (AccountBundleImportResult, error)
- func (s AccountService) List() (AccountListResult, error)
- func (s AccountService) RefreshWithRequest(ctx context.Context, request AccountRefreshRequest) (AccountResult, error)
- func (s AccountService) Remove(userID int64) (AccountResult, int64, error)
- func (s AccountService) Use(userID int64) (int64, error)
- type AuthBundleSDKClient
- type ClientRequest
- type ConfigMutationResult
- type ConfigService
- type ConfigStore
- type DownloadClient
- type DownloadFailure
- type DownloadManager
- type DownloadManagerFactory
- type DownloadQuality
- type DownloadReport
- type DownloadRequest
- type DownloadService
- func (s DownloadService) Download(ctx context.Context, client DownloadClient, request DownloadRequest) ([]DownloadedArtwork, error)
- func (s DownloadService) DownloadSources(ctx context.Context, client DownloadTargetClient, sources []string, ...) (DownloadReport, error)
- func (s DownloadService) DownloadTargets(ctx context.Context, client DownloadTargetClient, targets []sdk.Reference, ...) (DownloadReport, error)
- type DownloadTargetClient
- type DownloadedArtwork
- type DownloadedFile
- type LoginCompleteRequest
- type LoginService
- type LoginStart
- type PagePlan
- type PageResult
- type Record
- func ParseRecordJSON(line []byte) (Record, error)
- func RecordFromIllust(illust sdk.Illust) (Record, error)
- func RecordFromNovel(novel sdk.Novel) (Record, error)
- func RecordFromRecommendedUserPreview(preview sdk.RecommendedUserPreview) (Record, error)
- func RecordFromUserDetail(detail sdk.UserDetailResult) (Record, error)
- func RecordFromUserPreview(preview sdk.UserPreview) (Record, error)
- type RecordFilter
- type SDKClient
- type SDKClientFactory
- type SDKClientRequest
- type SDKPooledOperation
- type SDKService
- func (s SDKService) AuthBundleClient(req SDKClientRequest) (AuthBundleSDKClient, error)
- func (s SDKService) Client(req SDKClientRequest) (SDKClient, error)
- func (s SDKService) CurrentUserID(ctx context.Context, req SDKClientRequest) (SDKClient, int64, error)
- func (s SDKService) JSONOut(override *bool) (bool, error)
- func (s SDKService) OpenOperation(ctx context.Context, req SDKClientRequest) (SDKClient, error)
- func (s SDKService) RunPooledOperation(ctx context.Context, req SDKClientRequest, ...) error
- func (s SDKService) Runtime() (config.RuntimeConfig, error)
- type Services
- type UgoiraFormat
Constants ¶
const ( AccountImportStatusAdded = "added" AccountImportStatusUpdated = "updated" )
const ( DownloadQualityOriginal = sdk.DownloadQualityOriginal DownloadQualityRegular = sdk.DownloadQualityRegular DownloadQualitySmall = sdk.DownloadQualitySmall DownloadQualityThumb = sdk.DownloadQualityThumb DownloadQualityMini = sdk.DownloadQualityMini UgoiraFormatGIF = sdk.UgoiraFormatGIF UgoiraFormatAPNG = sdk.UgoiraFormatAPNG )
Variables ¶
var ( ParsePageSpec = sdk.ParsePageSpec ValidateDownloadQuality = sdk.ValidateDownloadQuality ValidateUgoiraFormat = sdk.ValidateUgoiraFormat )
var ErrAccountPoolExhausted = errors.New("account pool has no available account")
ErrAccountPoolExhausted 表示配置的账号均已冻结或均已在本次安全重放中尝试。 调用方可保留导致冻结的 *pixiv.Error 作为 error chain,以便维持稳定分类。
Functions ¶
Types ¶
type AccountBundleImportResult ¶ added in v0.4.0
type AccountBundleImportResult struct {
Accounts []AccountImportResult `json:"accounts"`
DefaultUserID int64 `json:"default_user_id"`
}
type AccountCheckRequest ¶
type AccountExportRequest ¶ added in v0.4.0
type AccountExportResult ¶ added in v0.4.0
type AccountImportRequest ¶ added in v0.4.0
type AccountImportResult ¶ added in v0.4.0
type AccountImportResult struct {
UserID int64 `json:"user_id"`
Username string `json:"username"`
Status string `json:"status"`
}
AccountImportResult 是 direct import 与 bundle restore 共用的安全报告 DTO。 它刻意不携带 token、default 或 has_token,避免导入报告复用账号列表契约。
type AccountListResult ¶
type AccountListResult struct {
DefaultUserID int64
Accounts []AccountResult
}
type AccountPoolExecutor ¶ added in v0.8.0
type AccountPoolExecutor struct {
Config config.AccountPoolConfig
State AccountPoolStateStore
AvailableAccounts func(context.Context) ([]int64, error)
Now func() time.Time
}
AccountPoolExecutor 将“选择本地受管账号”和“仅在安全边界前重放”收敛在 application。 它不暴露给 public SDK,也不保存凭据。
type AccountPoolStateStore ¶ added in v0.8.0
type AccountPoolStateStore interface {
Lease(context.Context, []int64, []int64, config.AccountPoolStrategy, time.Time) (int64, error)
Freeze(context.Context, int64, time.Time, time.Time) error
}
AccountPoolStateStore 让账号选择事务与具体的私有 JSON/文件锁实现隔离。 Lease 必须在持久状态中原子记录选中的 UID,Freeze 必须原子写入截止时间。
type AccountRefreshRequest ¶ added in v0.7.1
AccountRefreshRequest 指定要刷新凭据与账号状态的已保存账号;UID 为零时使用默认账号。 OpenOperation 负责刷新 OAuth access token 及可能轮换的 refresh token,随后强制更新 profile。
type AccountResult ¶
type AccountResult struct {
UserID int64 `json:"user_id,omitempty"`
Username string `json:"username,omitempty"`
Default bool `json:"default"`
HasToken bool `json:"has_token"`
PremiumStatus *bool `json:"premium_status,omitempty"`
PremiumStatusCheckedAt *time.Time `json:"premium_status_checked_at,omitempty"`
Warning string `json:"warning,omitempty"`
}
type AccountService ¶
type AccountService struct {
SDK SDKService
RefreshTokenFromEnv func() (string, error)
}
AccountService 只适配 public SDK 的本地账号 API。账号文件、token rotation 和 OAuth 身份验证均由 SDK 维护,应用层不再复制另一份 auth store 调用链。
func (AccountService) Check ¶
func (s AccountService) Check(ctx context.Context, userID int64) (AccountResult, error)
func (AccountService) CheckWithRequest ¶
func (s AccountService) CheckWithRequest(ctx context.Context, request AccountCheckRequest) (AccountResult, error)
func (AccountService) Export ¶ added in v0.4.0
func (s AccountService) Export(request AccountExportRequest) (AccountExportResult, error)
Export 只通过 public SDK 读取本地认证快照;它不应用环境 token 或运行时 UID 覆写。
func (AccountService) Import ¶ added in v0.4.0
func (s AccountService) Import(ctx context.Context, request AccountImportRequest) (AccountImportResult, error)
func (AccountService) ImportBundle ¶ added in v0.4.0
func (s AccountService) ImportBundle(body []byte) (AccountBundleImportResult, error)
ImportBundle 解码并离线恢复 bundle;身份验证和 transport 均不参与此路径。
func (AccountService) List ¶
func (s AccountService) List() (AccountListResult, error)
func (AccountService) RefreshWithRequest ¶ added in v0.7.1
func (s AccountService) RefreshWithRequest(ctx context.Context, request AccountRefreshRequest) (AccountResult, error)
RefreshWithRequest 先建立一次稳定的已认证 SDK 操作快照,以刷新 access token 和可能 轮换的 refresh token;再强制读取个人 profile,将 Premium 资格与检查时间写回 auth store。
func (AccountService) Remove ¶
func (s AccountService) Remove(userID int64) (AccountResult, int64, error)
type AuthBundleSDKClient ¶ added in v0.4.0
type AuthBundleSDKClient interface {
ExportAuthBundle(sdk.AuthExportSelection) (*sdk.AuthExportBundle, error)
RestoreAuthBundle(*sdk.AuthExportBundle) (*sdk.AuthRestoreResult, error)
}
AuthBundleSDKClient 是离线认证 bundle 所需的独立 public SDK facade,避免把 secret-bearing 方法扩散到内容命令和 MCP 的通用测试替身。
type ClientRequest ¶
type ClientRequest struct {
UserID int64
RefreshToken string
HTTPSProxyOverride *string
JSONOverride *bool
NeedsAuth bool
}
ClientRequest 是 CLI 解析 flags 后的本地请求值。内容与下载命令会进一步转换为 SDKClientRequest;本类型不持有 Pixiv client,也不建立第二条认证或内容调用链。
type ConfigMutationResult ¶
type ConfigService ¶
type ConfigService struct {
Store ConfigStore
}
func (ConfigService) Get ¶
func (s ConfigService) Get(alias string) (config.SettingValue, error)
func (ConfigService) Path ¶
func (s ConfigService) Path() (string, error)
func (ConfigService) Set ¶
func (s ConfigService) Set(alias, raw string) (ConfigMutationResult, error)
func (ConfigService) Unset ¶
func (s ConfigService) Unset(alias string) (ConfigMutationResult, error)
type ConfigStore ¶
type ConfigStore interface {
Path() (string, error)
Get(string) (config.SettingValue, error)
Set(string, string) (ConfigMutationResult, error)
Unset(string) (ConfigMutationResult, error)
}
type DownloadClient ¶
type DownloadClient interface {
IllustDetail(context.Context, int64) (*sdk.IllustDetail, error)
UgoiraMetadata(context.Context, int64) (*sdk.UgoiraMetadataResult, error)
ParseResourceRef(string) (sdk.ResourceRef, error)
DownloadResource(context.Context, sdk.ResourceRef, string) (sdk.ResourceDownloadResult, error)
}
DownloadClient 是下载实现从 public SDK operation snapshot 使用的最小能力集。 application 只编排用例,不依赖具体下载器或 Pixiv 协议实现。
type DownloadFailure ¶ added in v0.7.0
type DownloadFailure struct {
URL string
IllustID int64
Type string
Message string
// Cause 只用于 application/CLI 判断账号池的安全重试边界,输出 adapter
// 只公开 Message,避免错误对象进入用户协议。
Cause error
}
DownloadFailure 是一次无状态批量下载中单个作品或作者列表读取的可展示失败。 Message 仅承接 SDK/下载器的安全错误文本,不保存用户输入的原始 URL。
type DownloadManager ¶ added in v0.4.0
type DownloadManager interface {
Download(context.Context, DownloadRequest) ([]DownloadedArtwork, error)
}
DownloadManager 接收完整 DownloadRequest,避免 CLI/MCP 与实现各自解析 pages/quality。
type DownloadManagerFactory ¶ added in v0.4.0
type DownloadManagerFactory func(client DownloadClient, downloadPath, filenameTemplate string) (DownloadManager, error)
type DownloadQuality ¶ added in v0.5.0
type DownloadQuality = sdk.DownloadQuality
质量与页选择契约由 public SDK 拥有,application 仅 alias 以便 CLI/MCP 共用。
type DownloadReport ¶ added in v0.7.0
type DownloadReport struct {
Items []DownloadedArtwork
Failures []DownloadFailure
Committed bool
}
DownloadReport 同时保留成功产物和独立失败,使作者全量下载无需持久化 job 状态也能说明结果。
type DownloadRequest ¶ added in v0.4.0
type DownloadRequest struct {
IllustIDs []int64
DownloadPath string
FilenameTemplate string
// Pages 为 1-based 页码列表;空表示全部页。由 ParsePageSpec 生成。
Pages []int
// Quality 默认 original。
Quality DownloadQuality
// UgoiraFormat 默认 GIF,仅影响 ugoira 的最终动画容器。
UgoiraFormat UgoiraFormat
}
type DownloadService ¶
type DownloadService struct {
NewManager DownloadManagerFactory
}
func (DownloadService) Download ¶
func (s DownloadService) Download(ctx context.Context, client DownloadClient, request DownloadRequest) ([]DownloadedArtwork, error)
Download 把 operation snapshot 与本次运行配置交给 composition root 注入的下载器。
func (DownloadService) DownloadSources ¶ added in v0.8.0
func (s DownloadService) DownloadSources(ctx context.Context, client DownloadTargetClient, sources []string, options sdk.DownloadOptions) (DownloadReport, error)
DownloadSources 是 CLI/MCP 的新入口:作品 PID、作品 URL、受资源策略允许的直链 都原样交给 public SDK 解析。用户主页 URL 是唯一的应用层展开规则,因为它代表 一组作品而非单个 SDK 下载来源。
func (DownloadService) DownloadTargets ¶ added in v0.7.0
func (s DownloadService) DownloadTargets(ctx context.Context, client DownloadTargetClient, targets []sdk.Reference, request DownloadRequest) (DownloadReport, error)
DownloadTargets 是旧嵌入下载器的兼容路径。新 CLI/MCP 使用 DownloadSources 并由 public SDK 统一调度并发;这里保留输入顺序逐项调用,避免旧 DownloadManager 的 路径和模板可变状态在并发下交叉。
type DownloadTargetClient ¶ added in v0.7.0
type DownloadTargetClient interface {
DownloadClient
UserArtworks(context.Context, sdk.UserArtworksRequest) (*sdk.IllustListResult, error)
}
DownloadTargetClient 在下载资源能力之外提供作者作品列表,用于把用户 URL 展开为视觉作品。 该接口仍只依赖顶层 public SDK 的规范化能力。
type DownloadedArtwork ¶ added in v0.4.0
type DownloadedArtwork struct {
IllustID int64
Title string
Author string
Type string
Files []DownloadedFile
}
type DownloadedFile ¶ added in v0.4.0
type LoginCompleteRequest ¶
type LoginService ¶
type LoginService struct {
SDK SDKService
LoadRuntime func() (config.RuntimeConfig, error)
}
LoginService 将浏览器交互同 public SDK 的一次性 LoginSession 连接起来。应用层不再 自行生成 PKCE、直连 OAuth 或写入 auth store。
func (LoginService) Complete ¶
func (s LoginService) Complete(ctx context.Context, start LoginStart, request LoginCompleteRequest) (AccountResult, error)
func (LoginService) Start ¶
func (s LoginService) Start(requests ...SDKClientRequest) (LoginStart, error)
type LoginStart ¶
type LoginStart struct {
AuthorizationURL string
// contains filtered or unexported fields
}
func (LoginStart) AcceptsCallbackURL ¶ added in v0.3.0
func (s LoginStart) AcceptsCallbackURL(rawURL string) bool
AcceptsCallbackURL 是浏览器、loopback 和手工 URL 输入的非消耗性校验入口。它把 state/verifier 保持在 public SDK 的不透明 LoginSession 内,调用方只能得到布尔结果。
type PageResult ¶ added in v0.4.0
PageResult 描述逻辑分页实际返回的条数以及上游是否仍有内容。
type Record ¶ added in v0.8.0
type Record struct {
// contains filtered or unexported fields
}
Record 是可在 CLI 管道和 MCP 之间共享的 Pixiv 实体 JSON 记录。 它保留源对象和外部程序提供的未知字段,同时固定顶层 id、type、url。
func ParseRecordJSON ¶ added in v0.8.0
ParseRecordJSON 解析一行 NDJSON 中的单个对象,并保留未知字段。
func RecordFromIllust ¶ added in v0.8.0
RecordFromIllust 将公开 SDK 的插画模型映射为管道记录。
func RecordFromNovel ¶ added in v0.8.0
RecordFromNovel 将公开 SDK 的小说模型映射为管道记录。
func RecordFromRecommendedUserPreview ¶ added in v0.8.0
func RecordFromRecommendedUserPreview(preview sdk.RecommendedUserPreview) (Record, error)
RecordFromRecommendedUserPreview 将推荐用户的完整预览 envelope 映射为管道记录。
func RecordFromUserDetail ¶ added in v0.8.0
func RecordFromUserDetail(detail sdk.UserDetailResult) (Record, error)
RecordFromUserDetail 将用户详情的完整 SDK envelope 映射为管道记录。Profile、 ProfilePublicity 和 Workspace 均保留在记录中,避免 MCP 统一结构丢失详情字段。
func RecordFromUserPreview ¶ added in v0.8.0
func RecordFromUserPreview(preview sdk.UserPreview) (Record, error)
RecordFromUserPreview 将公开 SDK 的用户列表 envelope 映射为管道记录。
func (Record) MarshalJSON ¶ added in v0.8.0
MarshalJSON 保留记录中的未知字段,并始终输出一个 JSON 对象。
func (Record) Matches ¶ added in v0.8.0
func (r Record) Matches(filter RecordFilter) bool
Matches 判断记录是否满足所有已设置的筛选条件,不修改记录内容。
func (*Record) UnmarshalJSON ¶ added in v0.8.0
UnmarshalJSON 让 MCP structured content 等 JSON 消费者可以把 records 重新解码为 Record,同时复用 NDJSON 输入的完整校验、ID 归一与版本元数据清理规则。
type RecordFilter ¶ added in v0.8.0
type RecordFilter struct {
ID string
Type string
Tags []string
MinViews *int64
MinPageCount *int64
}
RecordFilter 描述基于稳定记录字段的本地筛选条件。 MinViews 和 MinPageCount 为 nil 时不筛选对应字段。
type SDKClient ¶ added in v0.2.0
type SDKClient interface {
ImportAccount(context.Context, string) (*sdk.Account, error)
ListAccounts() (*sdk.AccountsResult, error)
SelectAccount(int64) error
RemoveAccount(int64) error
CheckAccount(context.Context, int64) (*sdk.Account, error)
CheckRefreshToken(context.Context, string) (*sdk.Account, error)
ExportAccountRefreshToken(int64) (string, error)
Refresh(context.Context) (*sdk.Account, error)
StartLogin() (*sdk.LoginSession, error)
CompleteLogin(context.Context, *sdk.LoginSession, string, sdk.LoginOptions) (*sdk.Account, error)
CurrentUserID(context.Context) (int64, error)
SearchIllust(context.Context, sdk.SearchIllustRequest) (*sdk.IllustListResult, error)
SearchNovel(context.Context, sdk.SearchNovelRequest) (*sdk.NovelListResult, error)
SearchIllustOptions(context.Context, sdk.SearchIllustOptionsRequest) (*sdk.SearchIllustOptionsResult, error)
IllustDetail(context.Context, int64) (*sdk.IllustDetail, error)
IllustRelated(context.Context, sdk.IllustRelatedRequest) (*sdk.IllustListResult, error)
IllustRanking(context.Context, sdk.IllustRankingRequest) (*sdk.IllustListResult, error)
IllustRecommended(context.Context, sdk.IllustRecommendedRequest) (*sdk.IllustListResult, error)
MangaRecommended(context.Context, sdk.IllustRecommendedRequest) (*sdk.IllustListResult, error)
NovelRecommended(context.Context, sdk.NovelRecommendedRequest) (*sdk.NovelListResult, error)
UserRecommended(context.Context, sdk.UserRecommendedRequest) (*sdk.UserRecommendedResult, error)
UserDetail(context.Context, sdk.UserDetailRequest) (*sdk.UserDetailResult, error)
UserArtworks(context.Context, sdk.UserArtworksRequest) (*sdk.IllustListResult, error)
UserBookmarks(context.Context, sdk.UserBookmarksRequest) (*sdk.IllustListResult, error)
UserBookmarksCursor(context.Context, sdk.UserBookmarksRequest, int64) (sdk.Cursor, error)
UserFollowing(context.Context, sdk.UserFollowingRequest) (*sdk.UserListResult, error)
FollowingIllusts(context.Context, sdk.FollowingIllustsRequest) (*sdk.IllustListResult, error)
FollowingNovels(context.Context, sdk.FollowingNovelsRequest) (*sdk.NovelListResult, error)
LatestIllusts(context.Context, sdk.LatestIllustsRequest) (*sdk.IllustListResult, error)
LatestNovels(context.Context, sdk.LatestNovelsRequest) (*sdk.NovelListResult, error)
MyPixivUsers(context.Context, sdk.MyPixivUsersRequest) (*sdk.UserListResult, error)
MyPixivIllusts(context.Context, sdk.MyPixivIllustsRequest) (*sdk.IllustListResult, error)
MyPixivNovels(context.Context, sdk.MyPixivNovelsRequest) (*sdk.NovelListResult, error)
UserNovels(context.Context, sdk.UserNovelsRequest) (*sdk.NovelListResult, error)
SearchUser(context.Context, sdk.SearchUserRequest) (*sdk.UserListResult, error)
TrendingTagsIllust(context.Context) (*sdk.TrendingTagsIllustResult, error)
UgoiraMetadata(context.Context, int64) (*sdk.UgoiraMetadataResult, error)
ParseResourceRef(string) (sdk.ResourceRef, error)
OpenResource(context.Context, sdk.OpenResourceRequest) (*sdk.ResourceResponse, error)
DownloadResource(context.Context, sdk.ResourceRef, string) (sdk.ResourceDownloadResult, error)
AddBookmark(context.Context, sdk.AddBookmarkRequest) error
RemoveBookmark(context.Context, sdk.RemoveBookmarkRequest) error
FollowUser(context.Context, sdk.FollowUserRequest) error
UnfollowUser(context.Context, sdk.UnfollowUserRequest) error
}
SDKClient 是 CLI 数据命令所需的窄 facade。它刻意不复用或导出旧 Source 的大接口, 让 CLI 通过公共 SDK 获得 cursor、错误和路由语义。
type SDKClientFactory ¶ added in v0.2.0
type SDKClientFactory func(SDKClientRequest) (SDKClient, error)
type SDKClientRequest ¶ added in v0.2.0
type SDKClientRequest struct {
UserID int64
RefreshToken string
HTTPSProxyOverride *string
// DisableRetryAfterRetry 只供账号池首个 429 的安全切换路径使用。
DisableRetryAfterRetry bool
// AuthFilePath 允许 MCP 等长驻调用方把 OAuth rotation 固定到同一个受保护 store。
// 为空时继续使用 OpenDefault 的标准路径。
AuthFilePath string
}
SDKClientRequest 只携带 CLI 显式覆写;其余 config/auth 优先级由 OpenDefault 在每次 SDK 操作快照中处理。
type SDKPooledOperation ¶ added in v0.8.0
type SDKPooledOperation func(context.Context, SDKClientRequest, func(context.Context, SDKClient) (committed bool, err error)) error
SDKPooledOperation 是生产组装提供的账号池执行边界。attempt 的 committed=true 表示已有记录输出或文件落盘,此后不得因 429 重放该次操作。
type SDKService ¶ added in v0.2.0
type SDKService struct {
NewClient SDKClientFactory
LoadRuntime func() (config.RuntimeConfig, error)
RunPooled SDKPooledOperation
}
func (SDKService) AuthBundleClient ¶ added in v0.4.0
func (s SDKService) AuthBundleClient(req SDKClientRequest) (AuthBundleSDKClient, error)
func (SDKService) Client ¶ added in v0.2.0
func (s SDKService) Client(req SDKClientRequest) (SDKClient, error)
func (SDKService) CurrentUserID ¶ added in v0.2.0
func (s SDKService) CurrentUserID(ctx context.Context, req SDKClientRequest) (SDKClient, int64, error)
CurrentUserID 通过 SDK OAuth 快照获取真实身份。这样 --refresh-token 和环境 token 都不会被本地默认账号误替代。
func (SDKService) JSONOut ¶ added in v0.2.0
func (s SDKService) JSONOut(override *bool) (bool, error)
JSONOut 与既有 CLI config 语义一致:命令显式 --json 覆盖 runtime 配置。
func (SDKService) OpenOperation ¶ added in v0.2.0
func (s SDKService) OpenOperation(ctx context.Context, req SDKClientRequest) (SDKClient, error)
OpenOperation 让一个 CLI 命令的 self 身份解析和所有 cursor 页面共享同一个 OpenDefault 快照,避免 OAuth rotation 在命令进行中使旧 refresh token 失效。
func (SDKService) RunPooledOperation ¶ added in v0.8.0
func (s SDKService) RunPooledOperation(ctx context.Context, req SDKClientRequest, attempt func(context.Context, SDKClient) (committed bool, err error)) error
RunPooledOperation 在未启用账号池时保持单账号 operation 语义;生产组装提供 RunPooled 时由其负责本地账号校验、持久状态和有限的 Retry-After 切换。
func (SDKService) Runtime ¶ added in v0.3.0
func (s SDKService) Runtime() (config.RuntimeConfig, error)
Runtime 返回当前本地运行配置,供下载路径这类 SDK 之外的本地输出策略使用。
type Services ¶
type Services struct {
Account AccountService
Config ConfigService
Login LoginService
SDK SDKService
Download DownloadService
}
Services 只组合应用层的本地适配与 public SDK facade。
type UgoiraFormat ¶ added in v0.8.0
type UgoiraFormat = sdk.UgoiraFormat