Documentation
¶
Index ¶
- func GenerateAtomFeed(ctx fiber.Ctx) error
- func GetHandleListArtworks(serv *service.Service, cfg runtimecfg.RestConfig) fiber.Handler
- func HandleCountArtwork(ctx fiber.Ctx) error
- func HandleFetchArtwork(ctx fiber.Ctx) error
- func HandleGetArtistByID(ctx fiber.Ctx) error
- func HandleGetArtworkByID(ctx fiber.Ctx) error
- func HandleGetPictureFileByID(ctx fiber.Ctx) error
- func HandleGetRandomPicture(ctx fiber.Ctx) error
- func HandleGetRandomTags(ctx fiber.Ctx) error
- func HandleGetSizedPictureFileByID(ctx fiber.Ctx) error
- func HandleRandomArtworks(ctx fiber.Ctx) error
- func HandleRandomPreviewArtworks(ctx fiber.Ctx) error
- func HandleSendArtworkInfoByTelegramBot(ctx fiber.Ctx) error
- func MyIP(cfg runtimecfg.RestConfig) fiber.Handler
- func Register(router fiber.Router, serv *service.Service, cfg runtimecfg.RestConfig)
- type RequestCountArtwork
- type RequestFetchArtwork
- type RequestListArtworks
- type RequestRandomArtworks
- type RequestRandomTags
- type RequestSendArtworkInfoByTelegramBot
- type ResponseArtist
- type ResponseArtworkItem
- type ResponseFetchArtwork
- type ResponseFetchedArtist
- type ResponseFetchedPicture
- type ResponsePicture
- type ResponseTag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateAtomFeed ¶
func GetHandleListArtworks ¶
func GetHandleListArtworks(serv *service.Service, cfg runtimecfg.RestConfig) fiber.Handler
func HandleCountArtwork ¶
func HandleFetchArtwork ¶
func HandleGetArtistByID ¶
func HandleGetArtworkByID ¶
func HandleGetRandomPicture ¶
func HandleGetRandomTags ¶
func HandleRandomArtworks ¶
func HandleRandomPreviewArtworks ¶
获得一个 artwork 并返回其第一张图片的 regular 直链, for compatibility
func MyIP ¶
func MyIP(cfg runtimecfg.RestConfig) fiber.Handler
func Register ¶
func Register(router fiber.Router, serv *service.Service, cfg runtimecfg.RestConfig)
Types ¶
type RequestCountArtwork ¶
type RequestCountArtwork struct {
R18 int `query:"r18" form:"r18" json:"r18" validate:"omitempty,gte=0,lte=2" message:"r18 must be 0 (no R18), 1 (only R18) or 2 (both)"`
}
type RequestFetchArtwork ¶
type RequestFetchArtwork struct {
URL string `query:"url" form:"url" json:"url" validate:"required" message:"url is required and must be a valid url"`
}
type RequestListArtworks ¶
type RequestListArtworks struct {
R18 int `query:"r18" form:"r18" json:"r18" validate:"gte=0,lte=2" message:"r18 must be 0 (no R18), 1 (only R18) or 2 (both)"`
ArtistID string `` /* 126-byte string literal not displayed */
Tag string `query:"tag" form:"tag" json:"tag"`
Keyword string `query:"keyword" form:"keyword" json:"keyword" validate:"max=50" message:"keyword max length is 50"`
Page int64 `query:"page" form:"page" json:"page"`
PageSize int64 `` /* 132-byte string literal not displayed */
Hybrid bool `query:"hybrid" form:"hybrid" json:"hybrid"`
SimilarTarget string `` /* 146-byte string literal not displayed */
}
func (*RequestListArtworks) ID ¶
func (r *RequestListArtworks) ID() uint64
type RequestRandomArtworks ¶
type RequestRandomTags ¶
type RequestRandomTags struct {
Limit int `json:"limit" query:"limit" form:"limit" validate:"omitempty,min=1,max=200" message:"limit must be between 1 and 200"`
}
type RequestSendArtworkInfoByTelegramBot ¶
type RequestSendArtworkInfoByTelegramBot struct {
SourceURL string `json:"source_url" query:"source_url" form:"source_url" validate:"required"`
ChatID int64 `json:"chat_id" query:"chat_id" form:"chat_id" validate:"required"`
AppendCaption string `json:"append_caption" query:"append_caption" form:"append_caption"`
}
type ResponseArtist ¶
type ResponseArtworkItem ¶
type ResponseArtworkItem struct {
ID string `json:"id"`
CreatedAt string `json:"created_at"`
Title string `json:"title"`
Description string `json:"description"`
SourceURL string `json:"source_url"`
R18 bool `json:"r18"`
LikeCount uint `json:"like_count"`
Tags []string `json:"tags"`
Artist ResponseArtist `json:"artist"`
SourceType shared.SourceType `json:"source_type"`
Pictures []ResponsePicture `json:"pictures"`
}
type ResponseFetchArtwork ¶
type ResponseFetchArtwork struct {
CacheID string `json:"cache_id"`
Title string `json:"title"`
Description string `json:"description"`
SourceURL string `json:"source_url"`
R18 bool `json:"r18"`
Tags []string `json:"tags"`
Artist *ResponseFetchedArtist `json:"artist"`
SourceType shared.SourceType `json:"source_type"`
Pictures []*ResponseFetchedPicture `json:"pictures"`
}
type ResponseFetchedArtist ¶
type ResponseFetchedPicture ¶
type ResponsePicture ¶
type ResponsePicture struct {
ID string `json:"id"`
Width uint `json:"width"`
Height uint `json:"height"`
Index uint `json:"index"`
Hash string `json:"hash"`
ThumbHash string `json:"thumb_hash"`
FileName string `json:"file_name"`
MessageID int `json:"message_id"` // deprecated
Thumbnail string `json:"thumbnail"`
Regular string `json:"regular"`
}
type ResponseTag ¶
Click to show internal directories.
Click to hide internal directories.