core

package
v2.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Safe xRestrict = 0
	R18  xRestrict = 1
	R18G xRestrict = 2
)
View Source
const (
	Unrated aiType = 0
	NotAI   aiType = 1
	AI      aiType = 2
)

Variables

This section is empty.

Functions

func GetRankingCalendar

func GetRankingCalendar(c *fiber.Ctx, mode string, year, month int) (template.HTML, error)

func GetUserArtworksID

func GetUserArtworksID(id, category string, page int) (string, int, error)

func ProxyImages

func ProxyImages(s, proxy string) string

Types

type ArtworkBrief

type ArtworkBrief struct {
	ID           string `json:"id"`
	Title        string `json:"title"`
	ArtistID     string `json:"userId"`
	ArtistName   string `json:"userName"`
	ArtistAvatar string `json:"profileImageUrl"`
	Thumbnail    string `json:"url"`
	Pages        int    `json:"pageCount"`
	XRestrict    int    `json:"xRestrict"`
	AiType       int    `json:"aiType"`
}

func GetDiscoveryArtwork

func GetDiscoveryArtwork(c *fiber.Ctx, mode string) ([]ArtworkBrief, error)

func GetNewestArtworks

func GetNewestArtworks(c *fiber.Ctx, worktype string, r18 string) ([]ArtworkBrief, error)

func GetNewestFromFollowing

func GetNewestFromFollowing(c *fiber.Ctx, mode, page string) ([]ArtworkBrief, error)

func GetRelatedArtworks

func GetRelatedArtworks(c *fiber.Ctx, id string) ([]ArtworkBrief, error)

func GetUserArtworks

func GetUserArtworks(c *fiber.Ctx, id, ids string) ([]ArtworkBrief, error)

func GetUserBookmarks

func GetUserBookmarks(c *fiber.Ctx, id, mode string, page int) ([]ArtworkBrief, int, error)

type Comment

type Comment struct {
	AuthorID   string `json:"userId"`
	AuthorName string `json:"userName"`
	Avatar     string `json:"img"`
	Context    string `json:"comment"`
	Stamp      string `json:"stampId"`
	Date       string `json:"commentDate"`
}

func GetArtworkComments

func GetArtworkComments(c *fiber.Ctx, id string) ([]Comment, error)

type FrequentTag

type FrequentTag struct {
	Name           string `json:"tag"`
	TranslatedName string `json:"tag_translation"`
}

func GetFrequentTags

func GetFrequentTags(ids string) ([]FrequentTag, error)

type Illust

type Illust struct {
	ID              string        `json:"id"`
	Title           string        `json:"title"`
	Description     template.HTML `json:"description"`
	UserID          string        `json:"userId"`
	UserName        string        `json:"userName"`
	UserAccount     string        `json:"userAccount"`
	Date            time.Time     `json:"uploadDate"`
	Images          []Image       `json:"images"`
	Tags            []Tag         `json:"tags"`
	Pages           int           `json:"pageCount"`
	Bookmarks       int           `json:"bookmarkCount"`
	Likes           int           `json:"likeCount"`
	Comments        int           `json:"commentCount"`
	Views           int           `json:"viewCount"`
	CommentDisabled int           `json:"commentOff"`
	SanityLevel     int           `json:"sl"`
	XRestrict       xRestrict     `json:"xRestrict"`
	AiType          aiType        `json:"aiType"`
	User            UserBrief
	RecentWorks     []ArtworkBrief
	RelatedWorks    []ArtworkBrief
	CommentsList    []Comment
	IsUgoira        bool
}

func GetArtworkByID

func GetArtworkByID(c *fiber.Ctx, id string) (*Illust, error)

type Image

type Image struct {
	Small    string `json:"thumb_mini"`
	Medium   string `json:"small"`
	Large    string `json:"regular"`
	Original string `json:"original"`
}

func GetArtworkImages

func GetArtworkImages(c *fiber.Ctx, id string) ([]Image, error)

type ImageResponse

type ImageResponse struct {
	Urls map[string]string `json:"urls"`
}

type Ranking

type Ranking struct {
	Contents []struct {
		Title        string `json:"title"`
		Image        string `json:"url"`
		Pages        string `json:"illust_page_count"`
		ArtistName   string `json:"user_name"`
		ArtistAvatar string `json:"profile_img"`
		ID           int    `json:"illust_id"`
		ArtistID     int    `json:"user_id"`
		Rank         int    `json:"rank"`
	} `json:"contents"`

	Mode        string          `json:"mode"`
	Content     string          `json:"content"`
	Page        int             `json:"page"`
	Date        string          `json:"date"`
	RankTotal   int             `json:"rank_total"`
	CurrentDate string          `json:"date"`
	PrevDateRaw json.RawMessage `json:"prev_date"`
	NextDateRaw json.RawMessage `json:"next_date"`
	PrevDate    string
	NextDate    string
}

func GetRanking

func GetRanking(c *fiber.Ctx, mode, content, date, page string) (Ranking, error)

type SearchArtworks added in v2.0.1

type SearchArtworks struct {
	Artworks []ArtworkBrief `json:"data"`
	Total    int            `json:"total"`
}

type SearchResult added in v2.0.1

type SearchResult struct {
	Artworks SearchArtworks
	Popular  struct {
		Permanent []ArtworkBrief `json:"permanent"`
		Recent    []ArtworkBrief `json:"recent"`
	} `json:"popular"`
	RelatedTags []string `json:"relatedTags"`
}

func GetSearch added in v2.0.1

func GetSearch(c *fiber.Ctx, artworkType, name, order, age_settings, page string) (*SearchResult, error)

type Tag

type Tag struct {
	Name           string `json:"tag"`
	TranslatedName string `json:"translation"`
}

type TagDetail added in v2.0.1

type TagDetail struct {
	Name            string `json:"tag"`
	AlternativeName string `json:"word"`
	Metadata        struct {
		Detail string      `json:"abstract"`
		Image  string      `json:"image"`
		Name   string      `json:"tag"`
		ID     json.Number `json:"id"`
	} `json:"pixpedia"`
}

func GetTagData added in v2.0.1

func GetTagData(c *fiber.Ctx, name string) (TagDetail, error)

type User

type User struct {
	ID              string          `json:"userId"`
	Name            string          `json:"name"`
	Avatar          string          `json:"imageBig"`
	BackgroundImage string          `json:"background"`
	Following       int             `json:"following"`
	MyPixiv         int             `json:"mypixivCount"`
	Comment         template.HTML   `json:"commentHtml"`
	Webpage         string          `json:"webpage"`
	SocialRaw       json.RawMessage `json:"social"`
	Artworks        []ArtworkBrief  `json:"artworks"`
	ArtworksCount   int
	FrequentTags    []FrequentTag
	Social          map[string]map[string]string
	Background      map[string]interface{} `json:"background"`
}

func GetUserArtwork

func GetUserArtwork(c *fiber.Ctx, id, category string, page int) (User, error)

func (*User) ParseSocial

func (s *User) ParseSocial()

type UserBrief

type UserBrief struct {
	ID     string `json:"userId"`
	Name   string `json:"name"`
	Avatar string `json:"imageBig"`
}

func GetUserBasicInformation

func GetUserBasicInformation(c *fiber.Ctx, id string) (UserBrief, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL