validator

package
v1.2.20 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnimeType = "anime"
	MangaType = "manga"
)

Main types.

View Source
const (
	Winter = "winter"
	Spring = "spring"
	Summer = "summer"
	Fall   = "fall"
)

Season list.

View Source
const (
	TopAiring = iota + 1
	TopUpcoming
	TopTV
	TopMovie
	TopOVA
	TopONA
	TopSpecial
	TopPopularAnime
	TopFavoriteAnime
)

Top anime types.

View Source
const (
	TopManga = iota + 1
	TopNovel
	TopOneshot
	TopDoujin
	TopManhwa
	TopManhua
	TopPopularManga
	TopFavoriteManga
)

Top manga types.

View Source
const (
	TypeTV = iota + 1
	TypeOVA
	TypeMovie
	TypeSpecial
	TypeONA
	TypeMusic
)

Anime types.

View Source
const (
	TypeManga = iota + 1
	TypeLightNovel
	TypeOneShot
	TypeDoujinshi
	TypeManhwa
	TypeManhua

	TypeNovel
)

Manga types.

View Source
const (
	StatusOnGoing = iota + 1
	StatusFinished
	StatusUpcoming
	StatusHiatus       // manga only
	StatusDiscontinued // manga only
)

Anime & manga airing/publishing status.

View Source
const (
	StatusDefault = iota
	StatusCurrent
	StatusCompleted
	StatusOnHold
	StatusDropped

	StatusPlanned
	StatusAll
)

User list status.

View Source
const (
	RatingDefault = iota
	RatingG       // all ages
	RatingPG      // children
	RatingPG13    // teens 13 or older
	RatingR17     // 17+ (violence & profanity)
	RatingR       // mild nudity
	RatingRx      // hentai
)

Anime ratings.

View Source
const (
	OrderAnimeTitle = iota + 1
	OrderAnimeFinishDate
	OrderAnimeStartDate
	OrderAnimeScore

	OrderAnimeType

	OrderAnimeRated

	OrderAnimePriority
	OrderAnimeProgress
	OrderAnimeStorage
	OrderAnimeAirStart
	OrderAnimeAirEnd
)

User anime list order.

View Source
const (
	OrderMangaTitle = iota + 1
	OrderMangaFinishDate
	OrderMangaStartDate
	OrderMangaScore

	OrderMangaPriority
	OrderMangaChapter
	OrderMangaVolume
	OrderMangaType
	OrderMangaPublishStart
	OrderMangaPublishEnd
)

User manga list order.

View Source
const (
	AnimeReview = "anime"
	MangaReview = "manga"
	BestReview  = "bestvoted"
)

Review types.

View Source
const (
	GenderDefault = iota
	GenderMale
	GenderFemale
	GenderNonBinary
)

Gender list.

View Source
const (
	AllCategory = iota
	AnimeCategory
	ConventionCategory
	ActorCategory
	CharacterCategory
	CompanyCategory
	GameCategory
	JapanCategory
	CityCategory
	MusicCategory
	MangaCategory
	SchoolCategory
	OtherCategory
)

Club categories.

View Source
const (
	SortDefault = iota
	SortName
	SortComment
	SortPost

	SortMember
)

Club sorts.

View Source
const OrderDefault = iota

OrderDefault is default user list order.

View Source
const TopDefault = iota

TopDefault is default top list.

View Source
const TypeDefault = iota

TypeDefault is default anime/manga type.

Variables

This section is empty.

Functions

func New

New to create new validator.

Types

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

Validator will intercept and validate request data before processing the request.

func (*Validator) GetAnime

func (v *Validator) GetAnime(id int) (*model.Anime, int, error)

GetAnime to get anime details.

func (*Validator) GetAnimeArticle

func (v *Validator) GetAnimeArticle(id int) ([]model.ArticleItem, int, error)

GetAnimeArticle to get anime featured article list.

func (*Validator) GetAnimeCharacter

func (v *Validator) GetAnimeCharacter(id int) ([]model.CharacterItem, int, error)

GetAnimeCharacter to get anime character list.

func (*Validator) GetAnimeClub

func (v *Validator) GetAnimeClub(id int) ([]model.ClubItem, int, error)

GetAnimeClub to get anime club list.

func (*Validator) GetAnimeEpisode

func (v *Validator) GetAnimeEpisode(id int, page int) ([]model.Episode, int, error)

GetAnimeEpisode to get anime episode list.

func (*Validator) GetAnimeMoreInfo

func (v *Validator) GetAnimeMoreInfo(id int) (string, int, error)

GetAnimeMoreInfo to get anime more info.

func (*Validator) GetAnimeNews

func (v *Validator) GetAnimeNews(id int) ([]model.NewsItem, int, error)

GetAnimeNews to get anime news list.

func (*Validator) GetAnimePicture

func (v *Validator) GetAnimePicture(id int) ([]string, int, error)

GetAnimePicture to get anime picture list.

func (*Validator) GetAnimeRecommendation

func (v *Validator) GetAnimeRecommendation(id int) ([]model.Recommendation, int, error)

GetAnimeRecommendation to get anime recommendation list.

func (*Validator) GetAnimeReview

func (v *Validator) GetAnimeReview(id int, page int) ([]model.Review, int, error)

GetAnimeReview to get anime review list.

func (*Validator) GetAnimeStaff

func (v *Validator) GetAnimeStaff(id int) ([]model.Role, int, error)

GetAnimeStaff to get anime staff list.

func (*Validator) GetAnimeStats

func (v *Validator) GetAnimeStats(id int) (*model.Stats, int, error)

GetAnimeStats to get anime stats.

func (*Validator) GetAnimeVideo

func (v *Validator) GetAnimeVideo(id int, page int) (*model.Video, int, error)

GetAnimeVideo to get anime video list.

func (*Validator) GetAnimeWithGenre

func (v *Validator) GetAnimeWithGenre(id int, page int) ([]model.AnimeItem, int, error)

GetAnimeWithGenre to get anime list with specific genre.

func (*Validator) GetArticle

func (v *Validator) GetArticle(id int) (*model.Article, int, error)

GetArticle to get featured article detail information.

func (*Validator) GetArticleTag

func (v *Validator) GetArticleTag() ([]model.ArticleTagItem, int, error)

GetArticleTag to get featured article tag list.

func (*Validator) GetArticles

func (v *Validator) GetArticles(page int, tag string) ([]model.ArticleItem, int, error)

GetArticles to get featured article list.

func (*Validator) GetCharacter

func (v *Validator) GetCharacter(id int) (*model.Character, int, error)

GetCharacter to get character detail information.

func (*Validator) GetCharacterArticle

func (v *Validator) GetCharacterArticle(id int) ([]model.ArticleItem, int, error)

GetCharacterArticle to get character featured article list.

func (*Validator) GetCharacterClub

func (v *Validator) GetCharacterClub(id int) ([]model.ClubItem, int, error)

GetCharacterClub to get character club list.

func (*Validator) GetCharacterOgraphy

func (v *Validator) GetCharacterOgraphy(t string, id int) ([]model.Role, int, error)

GetCharacterOgraphy to get character animeography/mangaography list.

func (*Validator) GetCharacterPicture

func (v *Validator) GetCharacterPicture(id int) ([]string, int, error)

GetCharacterPicture to get character picture list.

func (*Validator) GetCharacterVA added in v1.2.0

func (v *Validator) GetCharacterVA(id int) ([]model.Role, int, error)

GetCharacterVA to get character voice actor list.

func (*Validator) GetClub

func (v *Validator) GetClub(id int) (*model.Club, int, error)

GetClub to get club detail information.

func (*Validator) GetClubMember

func (v *Validator) GetClubMember(id int, page int) ([]model.ClubMember, int, error)

GetClubMember to get club member list.

func (*Validator) GetClubPicture

func (v *Validator) GetClubPicture(id int) ([]string, int, error)

GetClubPicture to get club picture list.

func (*Validator) GetClubRelated

func (v *Validator) GetClubRelated(id int) (*model.ClubRelated, int, error)

GetClubRelated to get club related list.

func (*Validator) GetClubs

func (v *Validator) GetClubs(page int) ([]model.ClubSearch, int, error)

GetClubs to get club list.

func (*Validator) GetGenres

func (v *Validator) GetGenres(t string) ([]model.ItemCount, int, error)

GetGenres to get anime/manga genre list.

func (*Validator) GetMagazine

func (v *Validator) GetMagazine(id int, page int) ([]model.MangaItem, int, error)

GetMagazine to get magazine manga list.

func (*Validator) GetMagazines

func (v *Validator) GetMagazines() ([]model.ItemCount, int, error)

GetMagazines to get manga magazine/serialization list.

func (*Validator) GetManga

func (v *Validator) GetManga(id int) (*model.Manga, int, error)

GetManga to get manga detail information.

func (*Validator) GetMangaArticle

func (v *Validator) GetMangaArticle(id int) ([]model.ArticleItem, int, error)

GetMangaArticle to get manga featured article list.

func (*Validator) GetMangaCharacter

func (v *Validator) GetMangaCharacter(id int) ([]model.Role, int, error)

GetMangaCharacter to get manga character list.

func (*Validator) GetMangaClub

func (v *Validator) GetMangaClub(id int) ([]model.ClubItem, int, error)

GetMangaClub to get manga club list.

func (*Validator) GetMangaMoreInfo

func (v *Validator) GetMangaMoreInfo(id int) (string, int, error)

GetMangaMoreInfo to get manga more info.

func (*Validator) GetMangaNews

func (v *Validator) GetMangaNews(id int) ([]model.NewsItem, int, error)

GetMangaNews to get manga news list.

func (*Validator) GetMangaPicture

func (v *Validator) GetMangaPicture(id int) ([]string, int, error)

GetMangaPicture to get manga picture list.

func (*Validator) GetMangaRecommendation

func (v *Validator) GetMangaRecommendation(id int) ([]model.Recommendation, int, error)

GetMangaRecommendation to get manga recommendation list.

func (*Validator) GetMangaReview

func (v *Validator) GetMangaReview(id int, page int) ([]model.Review, int, error)

GetMangaReview to get manga review list.

func (*Validator) GetMangaStats

func (v *Validator) GetMangaStats(id int) (*model.Stats, int, error)

GetMangaStats to get manga stats list.

func (*Validator) GetMangaWithGenre

func (v *Validator) GetMangaWithGenre(id int, page int) ([]model.MangaItem, int, error)

GetMangaWithGenre to get manga list with specific genre.

func (*Validator) GetNews

func (v *Validator) GetNews(id int) (*model.News, int, error)

GetNews to get news detail information.

func (*Validator) GetNewsList

func (v *Validator) GetNewsList(page int, tag string) ([]model.NewsItem, int, error)

GetNewsList to get news list.

func (*Validator) GetNewsTag

func (v *Validator) GetNewsTag() (*model.NewsTag, int, error)

GetNewsTag to get news tag list.

func (*Validator) GetPeople

func (v *Validator) GetPeople(id int) (*model.People, int, error)

GetPeople to get people detail information.

func (*Validator) GetPeopleArticle

func (v *Validator) GetPeopleArticle(id int) ([]model.ArticleItem, int, error)

GetPeopleArticle to get people featured article list.

func (*Validator) GetPeopleCharacter

func (v *Validator) GetPeopleCharacter(id int) ([]model.PeopleCharacter, int, error)

GetPeopleCharacter to get people anime character list.

func (*Validator) GetPeopleManga

func (v *Validator) GetPeopleManga(id int) ([]model.Role, int, error)

GetPeopleManga to get people published manga list.

func (*Validator) GetPeopleNews

func (v *Validator) GetPeopleNews(id int) ([]model.NewsItem, int, error)

GetPeopleNews to get people news list.

func (*Validator) GetPeoplePicture

func (v *Validator) GetPeoplePicture(id int) ([]string, int, error)

GetPeoplePicture to get people picture list.

func (*Validator) GetPeopleStaff

func (v *Validator) GetPeopleStaff(id int) ([]model.Role, int, error)

GetPeopleStaff to get people anime staff list.

func (*Validator) GetProducer

func (v *Validator) GetProducer(id int, page int) ([]model.AnimeItem, int, error)

GetProducer to get producer anime list.

func (*Validator) GetProducers

func (v *Validator) GetProducers() ([]model.ItemCount, int, error)

GetProducers to get anime producer/studio/licensor list.

func (*Validator) GetRecommendation

func (v *Validator) GetRecommendation(t string, id1, id2 int) (*model.Recommendation, int, error)

GetRecommendation to get recommendation detail information.

func (*Validator) GetRecommendations

func (v *Validator) GetRecommendations(t string, page int) ([]model.Recommendation, int, error)

GetRecommendations to get anime/manga recommendation list.

func (*Validator) GetReview

func (v *Validator) GetReview(id int) (*model.Review, int, error)

GetReview to get review detail information.

func (*Validator) GetReviews

func (v *Validator) GetReviews(t string, page int) ([]model.Review, int, error)

GetReviews to get anime/manga/best review list.

func (*Validator) GetSeason

func (v *Validator) GetSeason(season string, year int) ([]model.AnimeItem, int, error)

GetSeason to get seasonal anime list.

func (*Validator) GetTopAnime

func (v *Validator) GetTopAnime(t int, p int) ([]model.TopAnime, int, error)

GetTopAnime to get top anime list.

func (*Validator) GetTopCharacter

func (v *Validator) GetTopCharacter(page int) ([]model.TopCharacter, int, error)

GetTopCharacter to get top character list.

func (*Validator) GetTopManga

func (v *Validator) GetTopManga(t int, p int) ([]model.TopManga, int, error)

GetTopManga to get top manga list.

func (*Validator) GetTopPeople

func (v *Validator) GetTopPeople(page int) ([]model.TopPeople, int, error)

GetTopPeople to get top people list.

func (*Validator) GetUser

func (v *Validator) GetUser(username string) (*model.User, int, error)

GetUser to get user detail information.

func (*Validator) GetUserAnime

func (v *Validator) GetUserAnime(query model.UserListQuery) ([]model.UserAnime, int, error)

GetUserAnime to get user anime list.

func (*Validator) GetUserClub

func (v *Validator) GetUserClub(username string) ([]model.Item, int, error)

GetUserClub to get user club list.

func (*Validator) GetUserFavorite

func (v *Validator) GetUserFavorite(username string) (*model.UserFavorite, int, error)

GetUserFavorite to get user favorite list.

func (*Validator) GetUserFriend

func (v *Validator) GetUserFriend(username string, page int) ([]model.UserFriend, int, error)

GetUserFriend to get user friend list.

func (*Validator) GetUserHistory

func (v *Validator) GetUserHistory(username string, t string) ([]model.UserHistory, int, error)

GetUserHistory to get user history list.

func (*Validator) GetUserManga

func (v *Validator) GetUserManga(query model.UserListQuery) ([]model.UserManga, int, error)

GetUserManga to get user manga list.

func (*Validator) GetUserRecommendation

func (v *Validator) GetUserRecommendation(username string, page int) ([]model.Recommendation, int, error)

GetUserRecommendation to get user recommendation list.

func (*Validator) GetUserReview

func (v *Validator) GetUserReview(username string, page int) ([]model.Review, int, error)

GetUserReview to get user review list.

func (*Validator) GetUserStats

func (v *Validator) GetUserStats(username string) (*model.UserStats, int, error)

GetUserStats to get user stats detail information.

func (*Validator) SearchAnime

func (v *Validator) SearchAnime(query model.Query) ([]model.AnimeSearch, int, error)

SearchAnime to search anime with advanced query.

func (*Validator) SearchCharacter

func (v *Validator) SearchCharacter(name string, page int) ([]model.CharacterSearch, int, error)

SearchCharacter to search character.

func (*Validator) SearchClub

func (v *Validator) SearchClub(query model.ClubQuery) ([]model.ClubSearch, int, error)

SearchClub to search club with advanced query.

func (*Validator) SearchManga

func (v *Validator) SearchManga(query model.Query) ([]model.MangaSearch, int, error)

SearchManga to search manga with advanced query.

func (*Validator) SearchPeople

func (v *Validator) SearchPeople(name string, page int) ([]model.PeopleSearch, int, error)

SearchPeople to search people.

func (*Validator) SearchUser

func (v *Validator) SearchUser(query model.UserQuery) ([]model.UserSearch, int, error)

SearchUser to search club with advanced query.

Jump to

Keyboard shortcuts

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