Documentation
¶
Index ¶
- Variables
- func Init()
- type Kemono
- func (k *Kemono) FetchNewArtworks(ctx context.Context, limit int) ([]*dto.FetchedArtwork, error)
- func (k *Kemono) GetArtworkInfo(ctx context.Context, sourceURL string) (*dto.FetchedArtwork, error)
- func (k *Kemono) MatchesSourceURL(text string) (string, bool)
- func (k *Kemono) PrettyFileName(artwork shared.ArtworkLike, picture shared.PictureLike) string
- type KemonoCreatorProfileResp
- type KemonoPostAttachment
- type KemonoPostResp
- type KemonoPreview
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidKemonoPostURL = errors.New("invalid kemono post url") ErrNotPicture = errors.New("kemono post files or attachments are not pictures") )
Functions ¶
Types ¶
type Kemono ¶
type Kemono struct {
// contains filtered or unexported fields
}
func (*Kemono) FetchNewArtworks ¶
func (*Kemono) GetArtworkInfo ¶
func (*Kemono) PrettyFileName ¶
func (k *Kemono) PrettyFileName(artwork shared.ArtworkLike, picture shared.PictureLike) string
PrettyFileName implements source.ArtworkSource.
type KemonoPostAttachment ¶
type KemonoPostResp ¶
type KemonoPostResp struct {
Post struct {
ID string `json:"id"`
User string `json:"user"`
Service string `json:"service"`
Title string `json:"title"`
Content string `json:"content"`
File struct {
Name string `json:"name"`
Path string `json:"path"`
} `json:"file"` // 封面?
Tags []string `json:"tags"`
Attachments []KemonoPostAttachment `json:"attachments"`
} `json:"post"`
Previews []KemonoPreview `json:"previews"`
}
type KemonoPreview ¶
type KemonoPreview struct {
Type string `json:"type"` // "thumbnail" or others?
Server string `json:"server"` // cdn server, e.g. "https://n4.kemono.cr"
Name string `json:"name"` // file name, 好像没啥用
Path string `json:"path"` // file path, 和原图一致
}
Click to show internal directories.
Click to hide internal directories.