Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API contains all functions for api endpoints.
func (*API) HandleGetAnime ¶ added in v0.12.0
func (api *API) HandleGetAnime(w http.ResponseWriter, r *http.Request)
@summary Get anime list. @tags Anime @produce json @param title query string false "title" @param nsfw query string false "nsfw" enums(true,false) @param type query string false "type" enums(TV,OVA,ONA,MOVIE,SPECIAL,MUSIC) @param status query string false "status" enums(FINISHED,RELEASING,NOT_YET) @param season query string false "season" enums(WINTER,SPRING,SUMMER,FALL) @param season_year query integer false "season year" @param start_mean query number false "start mean" @param end_mean query number false "end mean" @param start_airing_year query number false "start airing year" @param end_airing_year query number false "end airing year" @param genre_id query integer false "genre id" @param studio_id query integer false "studio id" @param sort query string false "sort" enums(ID,-ID,TITLE,-TITLE,START_DATE,-START_DATE,MEAN,-MEAN,RANK,-RANK,POPULARITY,-POPULARITY,MEMBER,-MEMBER,VOTER,-VOTER) default(RANK) @param page query integer false "page" default(1) @param limit query integer false "limit" default(20) @success 200 {object} utils.Response{data=[]service.Anime,meta=service.Pagination} @failure 400 {object} utils.Response @failure 500 {object} utils.Response @router /anime [get]
func (*API) HandleGetAnimeByID ¶ added in v0.12.0
func (api *API) HandleGetAnimeByID(w http.ResponseWriter, r *http.Request)
@summary Get anime by id. @tags Anime @produce json @param animeID path integer true "anime id" @success 200 {object} utils.Response{data=service.Anime} @failure 202 {object} utils.Response @failure 400 {object} utils.Response @failure 404 {object} utils.Response @failure 500 {object} utils.Response @router /anime/{animeID} [get]
func (*API) Register ¶
func (api *API) Register(r chi.Router, nrApp *newrelic.Application)
Register to register api routes.