api

package
v0.0.57 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadComicOriginUrl

func DownloadComicOriginUrl(mediaId any, name string) string

func GetDomainId

func GetDomainId() int

func StoragePrefix added in v0.0.47

func StoragePrefix(cid int) string

Types

type ArchiveInfo

type ArchiveInfo struct {
	Path      string                   `json:"path,omitempty" bson:"path"`
	MD5       string                   `json:"md5,omitempty" bson:"md5"`
	Size      int64                    `json:"size,omitempty" bson:"size"`
	CreatedAt time.Time                `json:"created_at" bson:"created_at"`
	Algorithm string                   `json:"algorithm,omitempty" bson:"algorithm"`
	ByForce   bool                     `json:"by_force,omitempty" bson:"by_force"`
	Locators  []storage.StorageLocator `json:"locators,omitempty" bson:"locators"`
	storage.ReplicaHealth
	Status string `json:"status,omitempty" bson:"status,omitempty"` // "valid" | "stale"
}

type AutocompleteComic added in v0.0.55

type AutocompleteComic struct {
	CID   int    `json:"cid"`
	Title string `json:"title"`
}

AutocompleteComic 自动补全中漫画的轻量信息

type AutocompleteResponse added in v0.0.55

type AutocompleteResponse struct {
	Comics []*AutocompleteComic `json:"comics"`
	Tags   []*TagInfo           `json:"tags"`
}

AutocompleteResponse 自动补全响应

type BatchAddTagRequest added in v0.0.53

type BatchAddTagRequest struct {
	CIDList []int `json:"cidList"`
	Tag     Tag   `json:"tag"`
}

BatchAddTagRequest 批量添加 tag 请求

type BatchAddTagResponse added in v0.0.53

type BatchAddTagResponse struct {
	Updated int   `json:"updated"`
	Errors  []int `json:"errors,omitempty"`
}

BatchAddTagResponse 批量添加 tag 响应

type ComicImages

type ComicImages struct {
	Cover     PicInfo   `json:"cover" bson:"cover"`
	Pages     []PicInfo `json:"pages,omitempty" bson:"pages"`
	Thumbnail PicInfo   `json:"thumbnail" bson:"thumbnail"`
}

func (*ComicImages) CoverName

func (c *ComicImages) CoverName() string

func (*ComicImages) PageName

func (c *ComicImages) PageName(no int) string

func (*ComicImages) PageNameByIndex

func (c *ComicImages) PageNameByIndex(index int) string

func (*ComicImages) PageThumbnailName

func (c *ComicImages) PageThumbnailName(no int) string

func (*ComicImages) PageThumbnailNameByIndex

func (c *ComicImages) PageThumbnailNameByIndex(index int) string

func (*ComicImages) ThumbnailName

func (c *ComicImages) ThumbnailName() string

type ComicInfo

type ComicInfo struct {
	Oid      string      `json:"_id,omitempty" bson:"_id"`
	CID      int         `json:"cid,omitempty" bson:"cid"`
	Images   ComicImages `json:"images" bson:"images"`
	MediaId  string      `json:"media_id,omitempty" bson:"media_id"`
	NumPages int         `json:"num_pages,omitempty" bson:"num_pages"`
	Status   bool        `json:"status,omitempty" bson:"status"`
	Tags     Tags        `json:"tags,omitempty" bson:"tags"`
	Title    struct {
		English  string `json:"english,omitempty" bson:"english"`
		Japanese string `json:"japanese,omitempty" bson:"japanese"`
		Pretty   string `json:"pretty,omitempty" bson:"pretty"`
	} `json:"title" bson:"title"`
	UploadDate int64 `json:"upload_date,omitempty" bson:"upload_date"`

	VerifyInfo `json:"verify" bson:"verify"`
	Archive    *ArchiveInfo `json:"archive,omitempty" bson:"archive"`
	RedirectTo *int         `json:"redirect_to,omitempty" bson:"redirect_to,omitempty"`
	Deleted    bool         `json:"deleted,omitempty" bson:"deleted,omitempty"`
}

func (*ComicInfo) ArchiveDir

func (c *ComicInfo) ArchiveDir() string

func (*ComicInfo) ArchiveName added in v0.0.39

func (c *ComicInfo) ArchiveName() string

func (*ComicInfo) ArchiveTempDir added in v0.0.39

func (c *ComicInfo) ArchiveTempDir() string

func (*ComicInfo) CheckStatus

func (i *ComicInfo) CheckStatus()

func (*ComicInfo) PageOriginUrl

func (c *ComicInfo) PageOriginUrl(no int) string

func (*ComicInfo) PageOriginUrlByIndex

func (c *ComicInfo) PageOriginUrlByIndex(index int) string

func (*ComicInfo) PageOriginUrlByName

func (c *ComicInfo) PageOriginUrlByName(name string) string

func (*ComicInfo) PageSavePath

func (c *ComicInfo) PageSavePath(no int) string

func (*ComicInfo) PageSavePathByIndex

func (c *ComicInfo) PageSavePathByIndex(index int) string

func (*ComicInfo) PageSavePathByName

func (c *ComicInfo) PageSavePathByName(name string) string

func (*ComicInfo) SaveDir

func (c *ComicInfo) SaveDir() string

func (*ComicInfo) SaveDirName

func (c *ComicInfo) SaveDirName() (title string)

func (*ComicInfo) StoragePrefix added in v0.0.47

func (c *ComicInfo) StoragePrefix() string

type CreateRelationRequest added in v0.0.53

type CreateRelationRequest struct {
	Tags []TagBrief `json:"tags"`
}

CreateRelationRequest 创建关系组请求

type CreateRelationResponse added in v0.0.53

type CreateRelationResponse struct {
	ID        string     `json:"id"`
	Tags      []TagBrief `json:"tags"`
	CreatedAt string     `json:"created_at"`
}

CreateRelationResponse 创建关系组响应

type DeleteRelationRequest added in v0.0.53

type DeleteRelationRequest struct {
	ID string `json:"id"`
}

DeleteRelationRequest 删除关系组请求

type DownloadComicByIDRequest

type DownloadComicByIDRequest struct {
	Cid      int  `json:"cid"`
	MaxConn  int  `json:"max_conn"`
	MaxRetry int  `json:"max_retry"`
	Timeout  int  `json:"timeout"`
	IsSync   bool `json:"is_sync"`
	Force    bool `json:"force"`
}

type GetRelationsResponse added in v0.0.53

type GetRelationsResponse struct {
	Groups []RelationGroup `json:"groups"`
}

GetRelationsResponse 获取关系组列表响应

type OneComicInfo

type OneComicInfo struct {
	Comicid       string `json:"comicid"`
	Name          string `json:"name"`
	Desc          string `json:"desc"`
	Tag           string `json:"tag"`
	CoverImageUrl string `json:"cover_image_url"`
	Author        string `json:"author"`
	SourceUrl     string `json:"source_url"`
	SourceName    string `json:"source_name"`
	CrawlTime     string `json:"crawl_time"`
	Chapters      []struct {
		Title         string `json:"title"`
		ChapterNumber int    `json:"chapter_number"`
		SourceUrl     string `json:"source_url"`
	} `json:"chapters"`
	ExtChapters    []any  `json:"ext_chapters"`
	Status         string `json:"status"`
	Tags           []any  `json:"tags"`
	Site           string `json:"site"`
	LastUpdateTime string `json:"last_update_time"`

	VerifyInfo `json:"verify" bson:"verify"`
}

type PicInfo

type PicInfo struct {
	H      int    `json:"h,omitempty" bson:"h"`
	T      string `json:"t,omitempty" bson:"t"`
	W      int    `json:"w,omitempty" bson:"w"`
	Status bool   `json:"status,omitempty" bson:"status"`
}

func (PicInfo) PicType

func (p PicInfo) PicType() string

type RelatedTagsResponse added in v0.0.53

type RelatedTagsResponse struct {
	Tags []*TagInfo `json:"tags"`
}

RelatedTagsResponse 关联 tag 响应

type RelationGroup added in v0.0.53

type RelationGroup struct {
	ID        string     `json:"id"`
	Tags      []TagBrief `json:"tags"`
	CreatedAt string     `json:"created_at"`
}

RelationGroup 关系组信息(用于前端展示)

type RestoreComicByIDRequest

type RestoreComicByIDRequest struct {
	Cid     int  `json:"cid"`
	Timeout int  `json:"timeout"`
	IsSync  bool `json:"is_sync"`
}

type SearchUniqueTagsResponse added in v0.0.53

type SearchUniqueTagsResponse struct {
	Tags    []*TagInfo `json:"tags"`
	CIDList []int      `json:"cidList"`
	Total   int        `json:"total"`
}

SearchUniqueTagsResponse 搜索结果去重 tag 响应

type SetSettingsRequest

type SetSettingsRequest struct {
	Type     string         `json:"type"`
	Settings map[string]any `json:"settings"`
}

type Tag

type Tag struct {
	Count int    `json:"count,omitempty" bson:"count"`
	ID    int    `json:"id,omitempty" bson:"id"`
	Name  string `json:"name,omitempty" bson:"name"`
	Type  string `json:"type,omitempty" bson:"type"`
	URL   string `json:"url,omitempty" bson:"url"`
}

type TagBrief added in v0.0.53

type TagBrief struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Type string `json:"type"`
	URL  string `json:"url"`
}

TagBrief 关系组中单个 tag 的简要信息

type TagInfo

type TagInfo struct {
	ID       int    `bson:"id" json:"id"`
	Name     string `bson:"name" json:"name"`
	Type     string `bson:"type" json:"type"`
	URL      string `bson:"url" json:"url"`
	Count    int    `bson:"count" json:"count"`
	Like     bool   `bson:"like" json:"like"`
	Explicit bool   `bson:"explicit,omitempty" json:"explicit,omitempty"`
}

func (*TagInfo) SectionName

func (t *TagInfo) SectionName() string

type TagSearchResponse added in v0.0.53

type TagSearchResponse struct {
	Tags  []*TagInfo `json:"tags"`
	Total int        `json:"total"`
}

TagSearchResponse 标签搜索结果

type TagSectionIndex

type TagSectionIndex struct {
	Name  string
	Index int
	Page  int
}

type Tags

type Tags []Tag

func (Tags) IdString

func (tags Tags) IdString() string

func (Tags) NameString

func (tags Tags) NameString() string

func (Tags) SubTypeTags

func (tags Tags) SubTypeTags(subType string) Tags

type UpdateTagsRequest added in v0.0.53

type UpdateTagsRequest struct {
	CID     int   `json:"cid"`
	Added   []Tag `json:"added,omitempty"`
	Removed []Tag `json:"removed,omitempty"`
}

UpdateTagsRequest 单本漫画 tag 更新请求

type VerifyInfo

type VerifyInfo = comic.VerifyInfo

type VideoInfo

type VideoInfo struct {
	Oid          string    `json:"_id" bson:"_id"`
	Vid          string    `json:"vid" bson:"vid"`
	Context      string    `json:"@context" bson:"@context"`
	Type         string    `json:"@type" bson:"@type"`
	Name         string    `json:"name" bson:"name"`
	Description  string    `json:"description" bson:"description"`
	ThumbnailUrl []string  `json:"thumbnailUrl" bson:"thumbnail_url"`
	UploadDate   time.Time `json:"uploadDate" bson:"upload_date"`
	Author       struct {
		Type string `json:"@type" bson:"@type"`
		Name string `json:"name" bson:"name"`
	} `json:"author" bson:"author"`
	ContentUrl           string `json:"contentUrl" bson:"content_url"`
	InteractionStatistic struct {
		Type            string `json:"@type" bson:"type"`
		InteractionType struct {
			Type string `json:"@type" bson:"@type"`
		} `json:"interactionType" bson:"interaction_type"`
		UserInteractionCount int `json:"userInteractionCount" bson:"user_interaction_count"`
	} `json:"interactionStatistic" bson:"interaction_statistic"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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