Documentation
¶
Overview ¶
Package record owns the stable Pixiv record projection shared by CLI and MCP.
Index ¶
- type Record
- func NewIdentityRecord(id int64, recordType, rawURL string) (Record, error)
- func ParseRecordJSON(line []byte) (Record, error)
- func RecordFromArtworkDTO(artwork pixiv.ArtworkDTO) (Record, error)
- func RecordFromNovelContentDTO(content pixiv.NovelContentDTO) (Record, error)
- func RecordFromNovelDTO(novel pixiv.NovelDTO) (Record, error)
- func RecordFromUserDetailDTO(detail pixiv.UserDetailDTO) (Record, error)
- func RecordFromUserPreviewDTO(preview pixiv.UserPreviewDTO) (Record, error)
- type RecordFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Record ¶
type Record struct {
// contains filtered or unexported fields
}
Record 是可在 CLI 管道和 MCP 之间共享的 Pixiv 实体 JSON 记录。 它保留源对象和外部程序提供的未知字段,同时固定顶层 id、type、url。
func NewIdentityRecord ¶
NewIdentityRecord 构造只包含 Pixiv canonical identity 的管道记录。 artwork 表示尚无法可靠判断 illust/manga/ugoira 子类型的作品身份。
func ParseRecordJSON ¶
ParseRecordJSON 解析一行 NDJSON 中的单个对象,并保留未知字段。
func RecordFromArtworkDTO ¶
func RecordFromArtworkDTO(artwork pixiv.ArtworkDTO) (Record, error)
RecordFromArtworkDTO 将显式 DTO 映射为管道记录。运行时 SDK 模型必须先在 产品包内完成字段级转换,记录层不再通过反射猜测或脱敏运行时字段。
func RecordFromNovelContentDTO ¶ added in v1.0.2
func RecordFromNovelContentDTO(content pixiv.NovelContentDTO) (Record, error)
RecordFromUserPreviewDTO 将用户预览 DTO 映射为管道记录。 RecordFromNovelContentDTO 将结构化小说正文映射为可继续管道处理的小说记录。
func RecordFromNovelDTO ¶
RecordFromNovelDTO 将小说 DTO 映射为管道记录。
func RecordFromUserDetailDTO ¶
func RecordFromUserDetailDTO(detail pixiv.UserDetailDTO) (Record, error)
RecordFromUserDetailDTO 将用户详情 DTO 映射为管道记录。
func RecordFromUserPreviewDTO ¶
func RecordFromUserPreviewDTO(preview pixiv.UserPreviewDTO) (Record, error)
func (Record) MarshalJSON ¶
MarshalJSON 保留记录中的未知字段,并始终输出一个 JSON 对象。
func (Record) Matches ¶
func (r Record) Matches(filter RecordFilter) bool
Matches 判断记录是否满足所有已设置的筛选条件,不修改记录内容。
func (*Record) UnmarshalJSON ¶
UnmarshalJSON 让 MCP structured content 等 JSON 消费者可以把 records 重新解码为 Record,同时复用 NDJSON 输入的完整校验、ID 归一与版本元数据清理规则。