Documentation
¶
Index ¶
Constants ¶
View Source
const PixivAPI = "https://api.lolicon.app/setu/v2"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIRequest ¶
type APIResponse ¶
type APIResponse struct {
Error string `json:"error"`
Data []SinglePicture `json:"data"`
}
type OmegaPixivIllusts ¶
type OmegaPixivIllusts struct {
ID int `gorm:"column:id;primaryKey"`
PID int64 `gorm:"column:pid;uniqueIndex:ix_omega_pixiv_illusts_pid,type:btree"`
UID int64 `gorm:"column:uid;index:ix_omega_pixiv_illusts_uid,type:btree"`
Title string `gorm:"column:title;index:ix_omega_pixiv_illusts_title,type:btree"`
Uname string `gorm:"column:uname;index:ix_omega_pixiv_illusts_uname,type:btree"`
NsfwTag int `gorm:"column:nsfw_tag"` //nsfw标签, 0=safe, 1=setu, 2=r18
Width int `gorm:"column:width"`
Height int `gorm:"column:height"`
Tags string `gorm:"column:tags;size:1024"`
URL string `gorm:"column:url;size:1024"`
CreatedAt time.Time `gorm:"column:created_at"`
UpdatedAt time.Time `gorm:"column:updated_at"`
}
OmegaPixivIllusts Omega图库结构,请从https://github.com/Ailitonia/omega-miya/raw/master/archive_data/db_pixiv.7z手动导入数据库 特别鸣谢Ailitonia/omega-miya项目
func (OmegaPixivIllusts) TableName ¶
func (p OmegaPixivIllusts) TableName() string
type PictureGetter ¶
type PictureGetter func(tags []string, num int, isR18 bool) []PictureInfo
type PictureInfo ¶
type PictureInfo struct {
Title string // 标题
URL string // 图片链接
Tags []string // 标签
PID int64
P int // 分P
Author string // 作者
UID int64 // 作者UID
Src string // 无需填写,来源图库
}
func (*PictureInfo) GenSinglePicMsg ¶
func (pic *PictureInfo) GenSinglePicMsg() (message.Message, error)
GenSinglePicMsg 生成单条Pixiv消息
func (*PictureInfo) GetDescribe ¶ added in v0.1.2
func (pic *PictureInfo) GetDescribe() string
GetDescribe 获取图片说明
func (*PictureInfo) GetURLByPID ¶
func (pic *PictureInfo) GetURLByPID() (err error)
GetURLByPID 通过PID获取图片下载URL
func (*PictureInfo) ReplaceURLToProxy ¶ added in v0.1.2
func (pic *PictureInfo) ReplaceURLToProxy()
ReplaceURLToProxy 将图片URL替换为反代地址
type SinglePicture ¶
type SinglePicture struct {
Pid int64 `json:"pid"`
P int `json:"p"`
Uid int64 `json:"uid"`
Title string `json:"title"`
Author string `json:"author"`
R18 bool `json:"r18"`
Width int `json:"width"`
Height int `json:"height"`
Tags []string `json:"tags"`
Ext string `json:"ext"`
UploadDate int `json:"uploadDate"`
Urls map[string]string `json:"urls"`
}
Click to show internal directories.
Click to hide internal directories.