Documentation
¶
Index ¶
- Constants
- func TranslateSynopsis(t lang.Translator, a *Anime) (string, error)
- type Anime
- type AnimeAgeRating
- type AnimeApi
- type AnimeCollectionResponse
- type AnimeImage
- type AnimeImageDimension
- type AnimeImageDimensions
- type AnimeResourceResponse
- type AnimeStatus
- type AnimeSubtype
- type AnimeTitles
- type Attributes
- type Date
Constants ¶
View Source
const ( AnimeStatusUnknown = iota AnimeStatusCurrent AnimeStatusFinished AnimeStatusTba AnimeStatusUnreleased AnimeStatusUpcoming )
Variables ¶
This section is empty.
Functions ¶
func TranslateSynopsis ¶
func TranslateSynopsis(t lang.Translator, a *Anime) (string, error)
Types ¶
type Anime ¶
type Anime struct {
ID utils.StringInt `json:"id" validate:"required"`
Type string `json:"type" validate:"required"`
Links struct {
Self string `json:"self" validate:"required"`
} `json:"links"`
Attributes Attributes `json:"attributes"`
}
type AnimeAgeRating ¶
type AnimeAgeRating uint8
const ( AnimeAgeRatingUnknown AnimeAgeRating = iota AnimeAgeRatingGeneral AnimeAgeRatingParental AnimeAgeRatingRestricted AnimeAgeRatingExplicit )
func (*AnimeAgeRating) MarshalJSON ¶
func (ar *AnimeAgeRating) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*AnimeAgeRating) String ¶
func (ar *AnimeAgeRating) String() string
String implements fmt.Stringer.
func (AnimeAgeRating) StringPtBr ¶
func (ar AnimeAgeRating) StringPtBr() string
func (*AnimeAgeRating) UnmarshalJSON ¶
func (ar *AnimeAgeRating) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type AnimeApi ¶
type AnimeApi struct {
Client *http.Client
Timeout time.Duration
// contains filtered or unexported fields
}
func NewAnimeApi ¶
func (*AnimeApi) FetchByName ¶
func (a *AnimeApi) FetchByName(name string, limit, offset int) (*AnimeCollectionResponse, error)
type AnimeCollectionResponse ¶
type AnimeImage ¶
type AnimeImageDimension ¶
type AnimeImageDimensions ¶
type AnimeImageDimensions struct {
Tiny AnimeImageDimension `json:"tiny"`
Small AnimeImageDimension `json:"small"`
Medium AnimeImageDimension `json:"medium"`
Large AnimeImageDimension `json:"large"`
}
type AnimeResourceResponse ¶
type AnimeResourceResponse struct {
Data Anime `json:"data"`
}
type AnimeStatus ¶
type AnimeStatus uint8
func (*AnimeStatus) MarshalJSON ¶
func (as *AnimeStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (AnimeStatus) StringPtBr ¶
func (as AnimeStatus) StringPtBr() string
func (*AnimeStatus) UnmarshalJSON ¶
func (as *AnimeStatus) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type AnimeSubtype ¶
type AnimeSubtype uint8
const ( AnimeSubtypeUnknown AnimeSubtype = iota AnimeSubtypeONA AnimeSubtypeOVA AnimeSubtypeTV AnimeSubtypeMovie AnimeSubtypeMusic AnimeSubtypeSpecial )
func (*AnimeSubtype) MarshalJSON ¶
func (st *AnimeSubtype) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*AnimeSubtype) String ¶
func (st *AnimeSubtype) String() string
String implements fmt.Stringer.
func (AnimeSubtype) StringPtBr ¶
func (st AnimeSubtype) StringPtBr() string
func (*AnimeSubtype) UnmarshalJSON ¶
func (st *AnimeSubtype) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type AnimeTitles ¶
type Attributes ¶
type Attributes struct {
CreatedAt time.Time `json:"createdAt" validate:"required"`
UpdatedAt time.Time `json:"updatedAt" validate:"required"`
Slug string `json:"string"`
// The synopsis of the anime in english
Synopsis string `json:"synopsis" validate:"required"`
// Titles in different languages
Titles AnimeTitles `json:"titles"`
CanonicalTitle string `json:"canonicalTitle"`
AbbreviatedTitles []string `json:"abbreviatedTitles"`
AverageRating string `json:"averageRating"`
RatingFrequencies map[string]string `json:"ratingFrequencies"`
UserCount int32 `json:"userCount"`
FavoritesCount int32 `json:"favoritesCount"`
PopularityRank int32 `json:"popularityRank"`
RatingRank int32 `json:"ratingRank"`
StartDate Date `json:"startDate"`
EndDate Date `json:"endDate"`
AgeRating AnimeAgeRating `json:"ageRating" validate:"required"`
AgeRatingGuide string `json:"ageRatingGuide"`
Subtype AnimeSubtype `json:"subtype" validate:"required"`
Status AnimeStatus `json:"status" validate:"required"`
TBA string `json:"tba"`
EpisodeCount int32 `json:"episodeCount"`
EpisodeLength int32 `json:"episodeLength"`
NSFW bool `json:"nsfw"`
PosterImage AnimeImage `json:"posterImage"`
CoverImage AnimeImage `json:"coverImage"`
YoutubeVideoId string `json:"youtubeVideoId"`
}
type Date ¶
type Date struct {
// contains filtered or unexported fields
}
func (*Date) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Date) StringPtBr ¶
func (*Date) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
Click to show internal directories.
Click to hide internal directories.