Documentation ¶
Index ¶
- Constants
- Variables
- type AltTitles
- type Anime
- type AnimeListStatus
- type AnimeRecommendation
- type AnimeStatistics
- type AnimeUpdateResponse
- type Author
- type Broadcast
- type Client
- func (c Client) DeleteAnime(id int) error
- func (c Client) DeleteManga(id int) error
- func (c Client) GetAnimeById(anime *Anime, id int, fields []string) error
- func (c Client) GetAnimeList(animes *[]Anime, params *ListParams) (bool, error)
- func (c Client) GetAnimeRanking(animes *[]RankedAnime, params *RankingParams) error
- func (c Client) GetMangaById(manga *Manga, id int, fields []string) error
- func (c Client) GetMangaList(mangas *[]Manga, params *ListParams) (bool, error)
- func (c Client) GetMangaRanking(mangas *[]RankedManga, params *RankingParams) error
- func (c Client) GetSeasonalAnime(animes *[]Anime, params *SeasonalParams) error
- func (c Client) GetSelfInfo(user *User, getStatistics bool) error
- func (c Client) GetSuggestedAnime(animes *[]Anime, params *SuggestedParams) error
- func (c Client) SearchAnime(animes *[]Anime, params *SearchParams) error
- func (c Client) SearchManga(mangas *[]Manga, params *SearchParams) error
- func (c Client) UpdateAnime(res *AnimeUpdateResponse, id int, params map[string]interface{}) error
- func (c Client) UpdateManga(res *MangaUpdateResponse, id int, params map[string]interface{}) error
- type Genre
- type ListParams
- type MALError
- type Magazine
- type Manga
- type MangaListStatus
- type MangaRecommendation
- type MangaUpdateResponse
- type Picture
- type RankedAnime
- type RankedManga
- type RankingParams
- type RelatedAnime
- type RelatedManga
- type SearchParams
- type Season
- type SeasonalParams
- type Serialization
- type StatusStatistics
- type Studio
- type SuggestedParams
- type User
- type UserAnimeStatistics
Constants ¶
View Source
const ( // used by UpdateAnime IsRewatching = "is_rewatching" EpisodesWatched = "num_watched_episodes" TimesRewatched = "num_times_rewatched" RewatchValue = "rewatch_value" // used by UpdateManga IsRereading = "is_rereading" VolumesRead = "num_volumes_read" ChaptersRead = "num_chapters_read" TimesReread = "num_times_reread" RereadValue = "reread_value" // used by both Status = "status" Score = "score" Priority = "priority" Tags = "tags" Comments = "comments" )
for UpdateAnime/UpdateManga
View Source
const ( // for anime only RankingTypeAiring = "airing" RankingTypeUpcoming = "upcoming" RankingTypeTV = "tv" RankingTypeOVA = "ova" RankingTypeMovie = "movie" RankingTypeSpecial = "special" // for manga only RankingTypeManga = "manga" RankingTypeNovel = "novels" RankingTypeOneShot = "oneshots" RankingTypeDoujin = "doujin" RankingTypeManhwa = "manhwa" RankingTypeManhua = "manhua" // for both RankingTypeAll = "all" RankingTypeByPopularity = "bypopularity" RankingTypeFavorite = "favorite" )
for getting ranking list
View Source
const ( // for anime only SortByAnimeTitle = "anime_title" SortByAnimeStartDate = "anime_start_date" SortByAnimeId = "anime_id" // for manga only SortByMangaTitle = "manga_title" SortByMangaStartDate = "manga_start_date" SortByMangaId = "manga_id" // for both SortByListScore = "list_score" SortByListUpdatedAt = "list_updated_at" )
for anime/manga list sort
View Source
const ( // for anime only ListStatusWatching = "watching" ListStatusPTW = "plan_to_watch" // for manga only ListStatusReading = "reading" ListStatusPTR = "plan_to_read" // for both ListStatusCompleted = "completed" ListStatusOnHold = "on_hold" ListStatusDropped = "dropped" ListStatusAll = "" // for getting user lists only )
for anime/manga list status
View Source
const ( // season names SeasonWinter = "winter" SeasonSpring = "spring" SeasonSummer = "summer" SeasonFall = "fall" // sorting SeasonSortByAnimeScore = "anime_score" SeasonSortByNumListUsers = "num_list_users" )
for anime seasons
View Source
const BASE_URL string = "https://api.myanimelist.net/v2"
Variables ¶
View Source
var ( ErrLimitOutOfRange = errors.New("mg: invalid limit (out of range)") ErrInvalidField = errors.New("mg: invalid field passed") ErrInvalidRankingType = errors.New("mg: invalid ranking type") ErrInvalidSeason = errors.New("mg: invalid season") ErrInvalidSort = errors.New("mg: invalid sort") ErrInvalidStatus = errors.New("mg: invalid status") ErrInvalidScore = errors.New("mg: invalid score") ErrInvalidPriority = errors.New("mg: invalid priority") ErrInvalidRewatchValue = errors.New("mg: invalid rewatch value") ErrInvalidRereadValue = errors.New("mg: invalid reread value") ErrEmptySearchString = errors.New("mg: invalid search string (empty string)") ErrInvalidYear = errors.New("mg: invalid year (not integer)") ErrUnknownUpdateParam = errors.New("mg: unknown update param") ErrAnimeNotInList = errors.New("mg: anime is already not in list") ErrClientAuthNotSupported = errors.New("mg: function does not support client auth") )
View Source
var DefaultAnimeFields []string = []string{
"id",
"title",
"main_picture",
"alternative_titles",
"start_date",
"end_date",
"synopsis",
"mean",
"rank",
"popularity",
"num_list_users",
"num_scoring_users",
"nsfw",
"created_at",
"updated_at",
"media_type",
"status",
"genres",
"my_list_status",
"list_status",
"num_episodes",
"start_season",
"broadcast",
"source",
"average_episode_duration",
"rating",
"pictures",
"background",
"related_anime",
"related_manga",
"recommendations",
"studios",
"statistics",
}
View Source
var DefaultMangaFields []string = []string{
"id",
"title",
"main_picture",
"alternative_titles",
"start_date",
"end_date",
"synopsis",
"mean",
"rank",
"popularity",
"num_list_users",
"num_scoring_users",
"nsfw",
"created_at",
"updated_at",
"media_type",
"status",
"genres",
"my_list_status",
"num_volumes",
"num_chapters",
"authors{first_name,last_name}",
"pictures",
"background",
"related_anime",
"related_manga",
"recommendations",
"serialization",
}
Functions ¶
This section is empty.
Types ¶
type AltTitles ¶
type Anime ¶
type Anime struct { Id int `json:"id"` Title string `json:"title"` MainPicture Picture `json:"main_picture"` AltTitles AltTitles `json:"alternative_titles"` StartDate string `json:"start_date"` EndDate string `json:"end_date"` Synopsis string `json:"synopsis"` MeanScore float32 `json:"mean"` Rank int `json:"rank"` Popularity int `json:"popularity"` NumListUsers int `json:"num_list_users"` NumScoringUsers int `json:"num_scoring_users"` NSFWStatus string `json:"nsfw"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` MediaType string `json:"media_type"` Status string `json:"status"` Genres []Genre `json:"genres"` MyListStatus AnimeListStatus `json:"my_list_status"` ListStatus AnimeListStatus `json:"list_status"` NumEpisodes int `json:"num_episodes"` Season Season `json:"start_season"` Broadcast Broadcast `json:"broadcast"` Source string `json:"source"` DurationSeconds int `json:"average_episode_duration"` ParentalRating string `json:"rating"` Pictures []Picture `json:"pictures"` Background string `json:"background"` RelatedAnime []RelatedAnime `json:"related_anime"` Recommendations []AnimeRecommendation `json:"recommendations"` Studios []Studio `json:"studios"` Statistics AnimeStatistics `json:"statistics"` }
type AnimeListStatus ¶
type AnimeRecommendation ¶
type AnimeStatistics ¶
type AnimeStatistics struct { NumListUsers int `json:"num_list_users"` Status StatusStatistics `json:"status"` }
type AnimeUpdateResponse ¶
type AnimeUpdateResponse struct { Status string `json:"status"` Score int `json:"score"` EpWatched int `json:"num_episodes_watched"` IsRewatching bool `json:"is_rewatching"` StartDate string `json:"start_date"` FinishDate string `json:"finish_date"` Priority string `json:"priority"` TimesRewatched int `json:"num_times_rewatched"` RewatchValue int `json:"rewatch_value"` Tags string `json:"tags"` Comments string `json:"comments"` UpdatedAt string `json:"updated_at"` }
type Author ¶
type Broadcast ¶
type Client ¶
type Client struct { MainAuth string ClientAuth string ClientAuthOnly bool // contains filtered or unexported fields }
func (Client) GetAnimeById ¶
func (Client) GetAnimeList ¶
func (c Client) GetAnimeList(animes *[]Anime, params *ListParams) (bool, error)
func (Client) GetAnimeRanking ¶
func (c Client) GetAnimeRanking(animes *[]RankedAnime, params *RankingParams) error
func (Client) GetMangaById ¶
func (Client) GetMangaList ¶
func (c Client) GetMangaList(mangas *[]Manga, params *ListParams) (bool, error)
func (Client) GetMangaRanking ¶
func (c Client) GetMangaRanking(mangas *[]RankedManga, params *RankingParams) error
func (Client) GetSeasonalAnime ¶
func (c Client) GetSeasonalAnime(animes *[]Anime, params *SeasonalParams) error
func (Client) GetSuggestedAnime ¶
func (c Client) GetSuggestedAnime(animes *[]Anime, params *SuggestedParams) error
func (Client) SearchAnime ¶
func (c Client) SearchAnime(animes *[]Anime, params *SearchParams) error
func (Client) SearchManga ¶
func (c Client) SearchManga(mangas *[]Manga, params *SearchParams) error
type ListParams ¶
type ListParams struct { Username string Status string Sort string Limit int Offset int NSFW bool Fields []string }
func ListParamsNew ¶
func ListParamsNew() *ListParams
type Manga ¶
type Manga struct { Id int `json:"id"` Title string `json:"title"` MainPicture Picture `json:"main_picture"` AltTitles AltTitles `json:"alternative_titles"` StartDate string `json:"start_date"` EndDate string `json:"end_date"` Synopsis string `json:"synopsis"` MeanScore float32 `json:"mean"` Rank int `json:"rank"` Popularity int `json:"popularity"` NumListUsers int `json:"num_list_users"` NSFWStatus string `json:"nsfw"` Genres []Genre `json:"genres"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` MediaType string `json:"media_type"` Status string `json:"status"` MyListStatus MangaListStatus `json:"my_list_status"` ListStatus MangaListStatus `json:"list_status"` NumVolumes int `json:"num_volumes"` NumChapters int `json:"num_chapters"` Authors []Author `json:"authors"` Pictures []Picture `json:"pictures"` Background string `json:"background"` RelatedAnime []RelatedAnime `json:"related_anime"` RelatedManga []RelatedManga `json:"related_manga"` Recommendations []MangaRecommendation `json:"recommendations"` Serialization []Serialization `json:"serialization"` }
type MangaListStatus ¶
type MangaRecommendation ¶
type MangaUpdateResponse ¶
type MangaUpdateResponse struct { Status string `json:"status"` Score int `json:"score"` VolumesRead int `json:"num_volumes_read"` ChaptersRead int `json:"num_chapters_read"` IsRereading bool `json:"is_rereading"` StartDate string `json:"start_date"` FinishDate string `json:"finish_date"` Priority string `json:"priority"` TimesReread int `json:"num_times_reread"` RereadValue int `json:"reread_value"` Tags string `json:"tags"` Comments string `json:"comments"` UpdatedAt string `json:"updated_at"` }
type RankingParams ¶
func RankingParamsNew ¶
func RankingParamsNew() *RankingParams
type RelatedAnime ¶
type RelatedManga ¶
type SearchParams ¶
func SearchParamsNew ¶
func SearchParamsNew() *SearchParams
type SeasonalParams ¶
type SeasonalParams struct { Limit int Offset int NSFW bool Fields []string Year string Season string Sort string }
func SeasonalParamsNew ¶
func SeasonalParamsNew() *SeasonalParams
type Serialization ¶
type StatusStatistics ¶
type SuggestedParams ¶
func SuggestedParamsNew ¶
func SuggestedParamsNew() *SuggestedParams
type User ¶
type User struct { Id int `json:"id"` Name string `json:"name"` Picture string `json:"picture"` Gender string `json:"gender"` Birthday string `json:"birthday"` Location string `json:"location"` JoinedAt string `json:"joined_at"` TimeZone string `json:"time_zone"` IsSupporter bool `json:"is_supporter"` AnimeStatistics UserAnimeStatistics `json:"anime_statistics"` }
type UserAnimeStatistics ¶
type UserAnimeStatistics struct { NumWatching int `json:"num_items_watching"` NumCompleted int `json:"num_items_completed"` NumOnHold int `json:"num_items_on_hold"` NumDropped int `json:"num_items_dropped"` NumPlanned int `json:"num_items_plan_to_watch"` TotalAnimes int `json:"num_items"` DaysWatched float32 `json:"num_days_watched"` DaysWatching float32 `json:"num_days_watching"` DaysCompleted float32 `json:"num_days_completed"` DaysOnHold float32 `json:"num_days_on_hold"` DaysDropped float32 `json:"num_days_dropped"` TotalDays float32 `json:"num_days"` TotalEpisodes int `json:"num_episodes"` TimesRewatched int `json:"num_times_rewatched"` MeanScore float32 `json:"mean_score"` }
Click to show internal directories.
Click to hide internal directories.