Documentation ¶
Index ¶
- Variables
- type APIError
- type Alias
- type Client
- type Collection
- type CollectionType
- type CollectionsStatus
- type EpisodeDetail
- type EpisodeService
- type EpisodeStatus
- type EpisodeType
- type Images
- type Info
- type Infobox
- type Rating
- type RatingCount
- type ResponseGroup
- type Subject
- type SubjectService
- type SubjectType
- type Tag
Constants ¶
This section is empty.
Variables ¶
View Source
var StatusCode = map[int]string{
200: "OK",
202: "Accepted",
304: "Not Modified",
30401: "Not Modified: Collection already exists",
400: "Bad Request",
40001: "Error: Nothing found with that ID",
401: "Unauthorized",
40101: "Error: Auth failed over 5 times",
40102: "Error: Username is not an Email address",
404: "Not Found",
405: "Method Not Allowed",
}
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Subject *SubjectService Episode *EpisodeService // contains filtered or unexported fields }
type Collection ¶
type CollectionType ¶
type CollectionType string
const ( CollectionTypeWatching CollectionType = "watching" // 在看的动画与三次元条目 CollectionTypeAllWatching CollectionType = "all_watching" // 在看的动画三次元与书籍条目 )
type CollectionsStatus ¶
type CollectionsStatus string
const ( CollectionsStatusWish CollectionsStatus = "wish" CollectionsStatusCollect CollectionsStatus = "collect" CollectionsStatusDo CollectionsStatus = "do" CollectionsStatusOnHold CollectionsStatus = "on_hold" CollectionsStatusDropped CollectionsStatus = "dropped" )
type EpisodeDetail ¶
type EpisodeDetail struct { ID int `json:"id"` /// 0 本篇,1 SP,2 OP,3 ED Type EpisodeType `json:"type"` Name string `json:"name"` NameCN string `json:"name_cn"` /// 同类条目的排序和集数 Sort int `json:"sort"` /// 条目内的集数, 从1开始。非本篇剧集的此字段无意义 Ep int `json:"ep,omitempty"` Airdate string `json:"airdate"` Comment int `json:"comment"` Duration string `json:"duration"` /// 简介 Desc string `json:"desc"` /// 音乐曲目的碟片数 Disc int `json:"disc"` SubjectID int `json:"subject_id"` }
type EpisodeService ¶
type EpisodeService struct {
// contains filtered or unexported fields
}
func (*EpisodeService) Get ¶
func (s *EpisodeService) Get(id int) (EpisodeDetail, *http.Response, error)
type EpisodeStatus ¶
type EpisodeStatus string
const ( EpisodeStatusEpWatched EpisodeStatus = "watched" EpisodeStatusEpQueue EpisodeStatus = "queue" EpisodeStatusEpDrop EpisodeStatus = "drop" EpisodeStatusEpRemove EpisodeStatus = "remove" )
type EpisodeType ¶
type EpisodeType int
const ( EpisodeTypeBase EpisodeType = iota EpisodeTypeSP EpisodeTypeOP EpisodeTypeED )
type Info ¶
type Info struct { Birth string `json:"birth,omitempty"` Height string `json:"height,omitempty"` Gender string `json:"gender,omitempty"` Alias Alias `json:"alias,omitempty"` // FIXME: some times string https://github.com/bangumi/api/issues/16 Source []string `json:"source,omitempty"` NameCN string `json:"name_cn,omitempty"` CV string `json:"cv,omitempty"` Twitter string `json:"twitter,omitempty"` }
Info represents a person/character info
type Rating ¶
type Rating struct { Rank int `json:"rank"` Total int `json:"total"` Count RatingCount `json:"count"` Score float64 `json:"score"` }
type RatingCount ¶
type ResponseGroup ¶
type ResponseGroup string
const ( ResponseSmall ResponseGroup = "small" ResponseMediam ResponseGroup = "mediam" ResponseLarge ResponseGroup = "large" )
type Subject ¶
type Subject struct { ID int `json:"id"` Type SubjectType `json:"type"` Name string `json:"name"` NameCN string `json:"name_cn"` Summary string `json:"summary"` NSFW bool `json:"nsfw"` Locked bool `json:"locked"` /// air date in YYYY-MM-DD format Date string `json:"date,omitempty"` /// TV, Web, 欧美剧, PS4... Platform string `json:"platform"` Images Images `json:"images,omitempty"` Infobox []Infobox `json:"infobox,omitempty"` /// 书籍条目的册数,由旧服务端从wiki中解析 Volumes int `json:"volumes"` /// 由旧服务端从wiki中解析,对于书籍条目为话数 Eps int `json:"eps"` /// 数据库中的章节数量 TotalEpisodes int `json:"total_episodes"` Rating Rating `json:"rating"` Collection Collection `json:"collection"` Tags []Tag `json:"tags"` }
type SubjectService ¶
type SubjectService struct {
// contains filtered or unexported fields
}
type SubjectType ¶
type SubjectType int
const ( SubjectTypeNil SubjectType = iota SubjectTypeBook SubjectTypeAnime SubjectTypeMusic SubjectTypeGame SubjectTypeReserved SubjectTypeReal )
Click to show internal directories.
Click to hide internal directories.