Documentation ¶
Index ¶
- Variables
- type AllGenres
- type CommonAnimeResult
- type Genre
- type HomePageParser
- func (p *HomePageParser) GetAllGenres()
- func (p *HomePageParser) GetMostFavoriteAnime()
- func (p *HomePageParser) GetRecentlyAddedAnime()
- func (p *HomePageParser) GetRecentlyUpdatedAnime()
- func (p *HomePageParser) GetSpotlightAnime()
- func (p *HomePageParser) GetTopAiringAnime()
- func (p *HomePageParser) GetTopViewedAnime()
- func (p *HomePageParser) GetTrendingAnime()
- func (p *HomePageParser) GetUpcomingAnime()
- type HomePageResources
- type MostFavoriteAnime
- type RecentlyAddedAnime
- type RecentlyUpdatedAnime
- type ScrapedHomePage
- type SpotlightAnime
- type Status
- type TopAiringAnime
- type TopViewedAnime
- type TopViewedAnimeResult
- type TrendingAnime
- type UpcomingAnime
Constants ¶
This section is empty.
Variables ¶
View Source
var Handler gin.HandlerFunc = func(ctx *gin.Context) { data, err := scrapeHomePage() if err != nil { log.Println(err) if config.IsHttpError(err) { config.HandleErr(ctx, err.(*config.HttpError)) return } config.HandleErr(ctx, config.NewHttpError(500)) return } ctx.JSON(200, data) }
Functions ¶
This section is empty.
Types ¶
type CommonAnimeResult ¶
type CommonAnimeResult struct { IDNumber int `json:"id_number"` MalID int `json:"mal_id,omitempty"` Name string `json:"name"` NameEnglish string `json:"name_english"` Slug string `json:"slug"` Overview string `json:"overview,omitempty"` Type *interface{} `json:"type"` CountryCode string `json:"country_code"` PosterPath string `json:"poster_path"` BackdropPath string `json:"backdrop_path,omitempty"` TotalEpisodes int `json:"total_episodes"` LatestEpisodeSub *int `json:"latest_episode_sub"` // using pointer to have "null" in json LatestEpisodeDub *int `json:"latest_episode_dub"` AiringStatus int `json:"airing_status"` AiredFrom string `json:"aired_from,omitempty"` Runtime int `json:"runtime"` RatingType *interface{} `json:"rating_type"` Genres []Genre `json:"genres"` ID string `json:"id"` TotalViewTop int `json:"totalViewTop,omitempty"` }
NOTE: using *interface{} to have "null" in json, because default value of string is ""
type HomePageParser ¶
type HomePageParser struct { Resp ScrapedHomePage // contains filtered or unexported fields }
func (*HomePageParser) GetAllGenres ¶
func (p *HomePageParser) GetAllGenres()
func (*HomePageParser) GetMostFavoriteAnime ¶
func (p *HomePageParser) GetMostFavoriteAnime()
func (*HomePageParser) GetRecentlyAddedAnime ¶
func (p *HomePageParser) GetRecentlyAddedAnime()
func (*HomePageParser) GetRecentlyUpdatedAnime ¶
func (p *HomePageParser) GetRecentlyUpdatedAnime()
func (*HomePageParser) GetSpotlightAnime ¶
func (p *HomePageParser) GetSpotlightAnime()
func (*HomePageParser) GetTopAiringAnime ¶
func (p *HomePageParser) GetTopAiringAnime()
func (*HomePageParser) GetTopViewedAnime ¶
func (p *HomePageParser) GetTopViewedAnime()
func (*HomePageParser) GetTrendingAnime ¶
func (p *HomePageParser) GetTrendingAnime()
func (*HomePageParser) GetUpcomingAnime ¶
func (p *HomePageParser) GetUpcomingAnime()
type HomePageResources ¶
type HomePageResources interface { TopAiringAnime | MostFavoriteAnime | SpotlightAnime }
type MostFavoriteAnime ¶
type MostFavoriteAnime struct { Status bool `json:"status"` Result []CommonAnimeResult `json:"result"` }
type RecentlyAddedAnime ¶
type RecentlyAddedAnime struct { Status `json:"status"` Result []CommonAnimeResult `json:"result"` }
type RecentlyUpdatedAnime ¶
type RecentlyUpdatedAnime struct { Status `json:"status"` Result []CommonAnimeResult `json:"result"` }
type ScrapedHomePage ¶
type ScrapedHomePage struct { Status `json:"status"` MostFavoriteAnimes []CommonAnimeResult `json:"mostFavoriteAnimes"` TopAiringAnimes []CommonAnimeResult `json:"topAiringAnimes"` SpotlightAnimes []CommonAnimeResult `json:"spotlightAnimes"` RecentlyUpdatedAnimes []CommonAnimeResult `json:"recentlyUpdatedAnimes"` TrendingAnimes []CommonAnimeResult `json:"trendingAnimes"` RecentlyAddedAnimes []CommonAnimeResult `json:"recentlyAddedAnimes"` TopViewedAnime TopViewedAnimeResult `json:"topViewedAnime"` UpcomingAnimes []CommonAnimeResult `json:"upcomingAnimes"` Genres []Genre `json:"genres"` }
type SpotlightAnime ¶
type SpotlightAnime struct { Status `json:"status"` Result []CommonAnimeResult `json:"result"` }
type TopAiringAnime ¶
type TopAiringAnime struct { Status bool `json:"status"` Result []CommonAnimeResult `json:"result"` }
type TopViewedAnime ¶
type TopViewedAnime struct { Status `json:"status"` Result TopViewedAnimeResult `json:"result"` }
type TopViewedAnimeResult ¶
type TopViewedAnimeResult struct { TopViewedDay []CommonAnimeResult `json:"topViewedDay"` TopViewedWeek []CommonAnimeResult `json:"topViewedWeek"` TopViewedMonth []CommonAnimeResult `json:"topViewedMonth"` }
type TrendingAnime ¶
type TrendingAnime struct { Status `json:"status"` Result []CommonAnimeResult `json:"result"` }
type UpcomingAnime ¶
type UpcomingAnime struct { Status `json:"status"` Result []CommonAnimeResult `json:"result"` }
Click to show internal directories.
Click to hide internal directories.