Documentation ¶
Index ¶
- Constants
- func TransformCharacterRole(characterRole string) *enum.CharacterRole
- func TransformMedias(mediaList Response[[]*AnimeData]) (medias []*domain.AnimeMedia)
- func TransformRelationType(relationType string) *enum.AnimeRelationType
- func TransformSubtype(subType string) *enum.Format
- type AnimeAttributes
- type AnimeCharactersAttributes
- type AnimeData
- type AnimeImage
- type AnimeProductionAttributes
- type CategoryAttributes
- type CharacterAttributes
- type CharacterImage
- type Dimensions
- type ErrorItem
- type GenreAttributes
- type ImageDimensions
- type ImageMetadata
- type IncludedItem
- type IncludedItemLinks
- type MediaCharacterAttributes
- type MediaRelationshipAttributes
- type ProducerAttributes
- type RelationshipItem
- type RelationshipItemData
- type RelationshipItemLinks
- type Relationships
- type Response
- type Service
Constants ¶
View Source
const ( KitsuSubTypeOVA = "OVA" KitsuSubTypeONA = "ONA" KitsuSubTypeTV = "TV" KitsuSubTypeMOVIE = "MOVIE" KitsuSubTypeMUSIC = "MUSIC" KitsuSubTypeSPECIAL = "SPECIAL" )
View Source
const ( KitsuStatusCURRENT = "CURRENT" KitsuStatusFINISHED = "FINISHED" KitsuStatusUPCOMING = "UPCOMING" KitsuStatusTBA = "TBA" )
View Source
const ( KitsuRelationTypeADAPTATION = "ADAPTATION" KitsuRelationTypePREQUEL = "PREQUEL" KitsuRelationTypeSEQUEL = "SEQUEL" KitsuRelationTypePARENT_STORY = "PARENTSTORY" KitsuRelationTypeSIDE_STORY = "SIDESTORY" KitsuRelationTypeSPINOFF = "SPINOFF" )
View Source
const ( KitsuCharacterRoleMAIN = "MAIN" KitsuCharacterRoleSUPPORTING = "SUPPORTING" )
View Source
const ( KitsuIncludeTypeAnime string = "anime" KitsuIncludeTypeGenres string = "genres" KitsuIncludeTypeCategories string = "categories" KitsuIncludeTypeMediaRelationships string = "mediarelationships" KitsuIncludeTypeManga string = "manga" KitsuIncludeTypeMediaCharacters string = "mediacharacters" KitsuIncludeTypeAnimeProductions string = "animeproductions" KitsuIncludeTypeProducers string = "producers" KitsuIncludeTypeAnimeCharacters string = "animecharacters" KitsuIncludeTypeCharacters string = "characters" )
Variables ¶
This section is empty.
Functions ¶
func TransformCharacterRole ¶
func TransformCharacterRole(characterRole string) *enum.CharacterRole
func TransformMedias ¶
func TransformMedias(mediaList Response[[]*AnimeData]) (medias []*domain.AnimeMedia)
func TransformRelationType ¶
func TransformRelationType(relationType string) *enum.AnimeRelationType
func TransformSubtype ¶
Types ¶
type AnimeAttributes ¶
type AnimeAttributes struct { UpdatedAt time.Time `json:"updatedAt,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty"` RatingFrequencies map[string]string `json:"ratingFrequencies,omitempty"` CoverImage *AnimeImage `json:"coverImage,omitempty"` PosterImage *AnimeImage `json:"posterImage,omitempty"` TBA *string `json:"tba,omitempty"` NextRelease *string `json:"nextRelease,omitempty"` Titles map[string]string `json:"titles,omitempty"` EndDate *string `json:"endDate,omitempty"` AgeRatingGuide string `json:"ageRatingGuide,omitempty"` ShowType string `json:"showType,omitempty"` YoutubeVideoID string `json:"youtubeVideoId,omitempty"` Slug string `json:"slug,omitempty"` StartDate *string `json:"startDate,omitempty"` CanonicalTitle string `json:"canonicalTitle,omitempty"` Synopsis string `json:"synopsis,omitempty"` Description string `json:"description,omitempty"` Status *string `json:"status,omitempty"` AgeRating string `json:"ageRating,omitempty"` AverageRating string `json:"averageRating,omitempty"` Subtype *string `json:"subtype,omitempty"` AbbreviatedTitles []string `json:"abbreviatedTitles,omitempty"` RatingRank int `json:"ratingRank,omitempty"` PopularityRank int `json:"popularityRank,omitempty"` CoverImageTopOffset int `json:"coverImageTopOffset,omitempty"` FavoritesCount int `json:"favoritesCount,omitempty"` EpisodeCount int `json:"episodeCount,omitempty"` EpisodeLength int `json:"episodeLength,omitempty"` TotalLength int `json:"totalLength,omitempty"` UserCount int `json:"userCount,omitempty"` NSFW bool `json:"nsfw,omitempty"` }
type AnimeData ¶
type AnimeData struct { Relationships Relationships `json:"relationships,omitempty"` Links RelationshipItemLinks `json:"links,omitempty"` ID string `json:"id,omitempty"` Type string `json:"type,omitempty"` Attributes AnimeAttributes `json:"attributes,omitempty"` }
type AnimeImage ¶
type CategoryAttributes ¶
type CategoryAttributes struct { CreatedAt *time.Time `json:"createdAt,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` Title string `json:"title,omitempty"` Description *string `json:"description,omitempty"` Slug string `json:"slug,omitempty"` TotalMediaCount int `json:"totalMediaCount,omitempty"` ChildCount int `json:"childCount,omitempty"` NSFW bool `json:"nsfw,omitempty"` }
type CharacterAttributes ¶
type CharacterAttributes struct { Image CharacterImage `json:"image,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty"` UpdatedAt time.Time `json:"updatedAt,omitempty"` Names map[string]string `json:"names,omitempty"` Slug string `json:"slug,omitempty"` CanonicalName string `json:"canonicalName,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` OtherNames []string `json:"otherNames,omitempty"` MalID int `json:"malId,omitempty"` }
type CharacterImage ¶
type Dimensions ¶
type ErrorItem ¶
type GenreAttributes ¶
type ImageDimensions ¶
type ImageDimensions struct { Tiny *Dimensions `json:"tiny,omitempty"` Large *Dimensions `json:"large,omitempty"` Small *Dimensions `json:"small,omitempty"` Medium *Dimensions `json:"medium,omitempty"` }
type ImageMetadata ¶
type ImageMetadata struct {
Dimensions ImageDimensions `json:"dimensions,omitempty"`
}
type IncludedItem ¶
type IncludedItem struct { Attributes interface{} `json:"attributes,omitempty"` Links *IncludedItemLinks `json:"links,omitempty"` Relationships *Relationships `json:"relationships,omitempty"` ID string `json:"id,omitempty"` Type string `json:"type,omitempty"` }
func (*IncludedItem) UnmarshalJSON ¶
func (h *IncludedItem) UnmarshalJSON(b []byte) error
type IncludedItemLinks ¶
type IncludedItemLinks struct {
Self string `json:"self"`
}
type ProducerAttributes ¶
type RelationshipItem ¶
type RelationshipItem[Data any] struct { Links *RelationshipItemLinks `json:"links,omitempty"` Data Data `json:"data,omitempty"` }
type RelationshipItemData ¶
type RelationshipItemLinks ¶
type Relationships ¶
type Relationships struct { Genres *RelationshipItem[[]*RelationshipItemData] `json:"genres,omitempty"` Categories *RelationshipItem[[]*RelationshipItemData] `json:"categories,omitempty"` Castings *RelationshipItem[[]*RelationshipItemData] `json:"castings,omitempty"` Installments *RelationshipItem[[]*RelationshipItemData] `json:"installments,omitempty"` Mappings *RelationshipItem[[]*RelationshipItemData] `json:"mappings,omitempty"` Reviews *RelationshipItem[[]*RelationshipItemData] `json:"reviews,omitempty"` MediaRelationships *RelationshipItem[[]*RelationshipItemData] `json:"mediaRelationships,omitempty"` Staff *RelationshipItem[[]*RelationshipItemData] `json:"staff,omitempty"` Productions *RelationshipItem[[]*RelationshipItemData] `json:"productions,omitempty"` Quotes *RelationshipItem[[]*RelationshipItemData] `json:"quotes,omitempty"` Episodes *RelationshipItem[[]*RelationshipItemData] `json:"episodes,omitempty"` StreamingLinks *RelationshipItem[[]*RelationshipItemData] `json:"streamingLinks,omitempty"` AnimeProductions *RelationshipItem[[]*RelationshipItemData] `json:"animeProductions,omitempty"` AnimeCharacters *RelationshipItem[[]*RelationshipItemData] `json:"animeCharacters,omitempty"` AnimeStaff *RelationshipItem[[]*RelationshipItemData] `json:"animeStaff,omitempty"` Source *RelationshipItem[[]*RelationshipItemData] `json:"source,omitempty"` Character *RelationshipItem[*RelationshipItemData] `json:"character,omitempty"` Destination *RelationshipItem[*RelationshipItemData] `json:"destination,omitempty"` Producer *RelationshipItem[*RelationshipItemData] `json:"producer,omitempty"` }
type Response ¶
type Response[Data any] struct { Data Data `json:"data,omitempty"` Included []*IncludedItem `json:"included,omitempty"` Errors []*ErrorItem `json:"error,omitempty"` }
type Service ¶
type Service interface {
GetMedia(ctx context.Context, ids ...string) ([]*domain.AnimeMedia, error)
}
func NewService ¶
func NewService( cacher cacher.Cacher, redisTTL configmodels.RedisKeyTTL, provider configmodels.ProviderConfig, ) Service
Click to show internal directories.
Click to hide internal directories.