domain

package
v0.0.0-...-3f23c4f Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatedAnime

type AggregatedAnime struct {
	StartDate       *time.Time                       `json:"startDate,omitempty"`
	Format          *enum.Format                     `json:"format,omitempty"`
	Season          *enum.Season                     `json:"season,omitempty"`
	CountryOfOrigin *string                          `json:"countryOfOrigin,omitempty"`
	SeasonYear      *int                             `json:"seasonYear,omitempty"`
	Banner          *string                          `json:"banner,omitempty"`
	Score           *int                             `json:"score,omitempty"`
	EndDate         *time.Time                       `json:"endDate,omitempty"`
	Status          *enum.Status                     `json:"status,omitempty"`
	Poster          *string                          `json:"poster,omitempty"`
	Providers       []*AggregatedAnimeProvider       `json:"providers,omitempty"`
	Titles          []*AggregatedAnimeTitle          `json:"titles,omitempty"`
	Tags            []string                         `json:"tags,omitempty"`
	Relations       []*AggregatedAnimeRelation       `json:"relations,omitempty"`
	Recommendations []*AggregatedAnimeRecommendation `json:"recommendations,omitempty"`
	Genres          []string                         `json:"genres,omitempty"`
	Studios         []string                         `json:"studios,omitempty"`
	Description     *string                          `json:"description,omitempty"`
	ID              uuid.UUID                        `json:"id"`
}

type AggregatedAnimeProvider

type AggregatedAnimeProvider struct {
	Provider   enum.AnimeProvider `json:"provider"`
	ProviderID string             `json:"providerID"`
	URL        string             `json:"url"`
}

type AggregatedAnimeRecommendation

type AggregatedAnimeRecommendation struct {
	ID     uuid.UUID `json:"id"`
	Rating float64   `json:"rating"`
}

type AggregatedAnimeRelation

type AggregatedAnimeRelation struct {
	ID   uuid.UUID              `json:"id"`
	Type enum.AnimeRelationType `json:"type"`
}

type AggregatedAnimeTitle

type AggregatedAnimeTitle struct {
	Provider enum.AnimeProvider  `json:"provider"`
	Type     enum.AnimeTitleType `json:"type"`
	Name     string              `json:"name"`
}

type AnimeMedia

type AnimeMedia struct {
	// Provider the kind of provider where the data was retrieved from.
	Provider enum.AnimeProvider `msgpack:"provider,omitempty" json:"provider,omitempty"`

	// ProviderID is the external identifier used by the provider
	// to identify the anime on their end.
	ProviderID string `msgpack:"providerID,omitempty" json:"providerID,omitempty"`

	// Titles are the anime media possible titles according to the provider.
	Titles []*AnimeMediaTitle `msgpack:"titles,omitempty" json:"titles,omitempty"`

	// Poster is the cover art for the anime.
	Poster string `msgpack:"poster,omitempty" json:"poster,omitempty"`

	// Banner is an optional if available banner for an anime.
	Banner *string `msgpack:"banner,omitempty" json:"banner,omitempty"`

	Logo *string `msgpack:"logo,omitempty" json:"logo,omitempty"`

	// Score is the average score provided by the provider, this is always in
	// in the 100 digit zone, so it's a percentage of how many people
	// like this anime or not.
	Score *int `msgpack:"score,omitempty" json:"score,omitempty"`

	// Description contains one or more paragraphs with a description of the
	// media.
	Description *string `msgpack:"description,omitempty" json:"description,omitempty"`

	// Status defines if the anime is still
	// ongoing/finished/cancelled/not yet released.
	Status *enum.Status `msgpack:"status,omitempty" json:"status,omitempty"`

	// Season could be either provided by the anime provider itself or
	// calculated based on the StartDate if that's given.
	Season *enum.Season `msgpack:"season,omitempty" json:"season,omitempty"`

	// SeasonYear could be either Provider by the anime provider itself or
	// calculated based on the StartDate if that's given.
	SeasonYear *int `msgpack:"seasonYear,omitempty" json:"seasonYear,omitempty"`

	// Format is the anime type, it wasn't created as an enum as the type
	// differs between providers. AniList has more values compared to Kitsu.
	Format *enum.Format `msgpack:"format,omitempty" json:"format,omitempty"`

	// Source is the origin of the anime, if it's based off a manga,
	// created based on a game story or a known movie and others...
	Source *string `msgpack:"source,omitempty" json:"source,omitempty"`

	// AgeRating is the G, PG, R, R18 age ratings that inform
	// the audience if it's appropriate for them.
	AgeRating *string `msgpack:"ageRating,omitempty" json:"ageRating,omitempty"`

	// StartDate is the starting date of the anime.
	StartDate *time.Time `msgpack:"startDate,omitempty" json:"startDate,omitempty"`

	// EndDate is the ending date of an anime, this field is known to be null
	// for ongoing / hiatus animes.
	EndDate *time.Time `msgpack:"endDate,omitempty" json:"endDate,omitempty"`

	// CountryOfOrigin is the country where the anime originated from
	// such as an anime could be Chinese or Japanese.
	CountryOfOrigin *string `msgpack:"countryOfOrigin,omitempty" json:"countryOfOrigin,omitempty"`

	// Genres is a list of genres this anime falls under.
	Genres []*AnimeMediaGenre `msgpack:"genres,omitempty" json:"genres,omitempty"`

	// Tags is a list of tags this anime falls under.
	Tags []*AnimeMediaTag `msgpack:"tags,omitempty" json:"tags,omitempty"`

	// Studios the studios responsible for the make of this anime.
	// This doesn't necessarily mean the publishers, but it's who aided with the
	// publishing of this media.
	Studios []*AnimeMediaStudio `msgpack:"studios,omitempty" json:"studios,omitempty"`

	// Relations defines the relation types between this media and other medias.
	// An example of a relation is a sequel and a prequel.
	Relations []*AnimeMediaRelation `msgpack:"relations,omitempty" json:"relations,omitempty"`

	// Recommendations defines a list of recommended media for this provider ID
	Recommendations []*AnimeMediaRecommendation `msgpack:"recommendations,omitempty" json:"recommendations,omitempty"`

	// Characters defines a list of characters along with their actors for this provider ID
	Characters []*AnimeMediaCharacter `msgpack:"characters,omitempty" json:"characters,omitempty"`
}

AnimeMedia is an aggregated type for all of our providers, there might be some datapoints that AniList doesn't provide while Kitsu provides, this is handled by the use of pointers in this case, the database entity contains columns which we only care about.

type AnimeMediaCharacter

type AnimeMediaCharacter struct {
	ID          string                      `json:"id,omitempty" msgpack:"id"`
	PrimaryName string                      `json:"primaryName,omitempty" msgpack:"primaryName,omitempty"`
	Names       []string                    `json:"names,omitempty" msgpack:"names,omitempty"`
	Poster      string                      `json:"poster,omitempty" msgpack:"poster,omitempty"`
	Gender      *string                     `json:"gender,omitempty" msgpack:"gender,omitempty"`
	Role        *enum.CharacterRole         `json:"role,omitempty" msgpack:"role,omitempty"`
	Description *string                     `json:"description,omitempty" msgpack:"description,omitempty"`
	Actors      []*AnimeMediaCharacterActor `json:"actors,omitempty" msgpack:"actors,omitempty"`
}

type AnimeMediaCharacterActor

type AnimeMediaCharacterActor struct {
	ID       string  `json:"id,omitempty" msgpack:"id,omitempty"`
	Name     string  `json:"name,omitempty" msgpack:"name,omitempty"`
	Language *string `json:"language,omitempty" msgpack:"language,omitempty"`
	Poster   string  `json:"poster,omitempty" msgpack:"poster,omitempty"`
}

type AnimeMediaGenre

type AnimeMediaGenre struct {
	ID          *string `msgpack:"id,omitempty" json:"id,omitempty"`
	Name        string  `msgpack:"name,omitempty" json:"name,omitempty"`
	Description *string `msgpack:"description,omitempty" json:"description,omitempty"`
}

AnimeMediaGenre was created rather than having the value as a string it'll be it's own model in-case we would like to add future properties.

type AnimeMediaImage

type AnimeMediaImage struct {
	Type      enum.AnimeImageType `msgpack:"type,omitempty" json:"type,omitempty"`
	Reference *string             `msgpack:"reference,omitempty" json:"reference,omitempty"`
	URL       *string             `msgpack:"url,omitempty" json:"url,omitempty"`
}

AnimeMediaImage defines either a new image set that needs to be created or a reference along with it's possibly matching URL.

type AnimeMediaRecommendation

type AnimeMediaRecommendation struct {
	ProviderID string  `msgpack:"providerID,omitempty" json:"providerID,omitempty"`
	Rating     float64 `msgpack:"rating,omitempty" json:"rating,omitempty"`
}

AnimeMediaRecommendation defines a recommendation with the media along with a rating.

type AnimeMediaRelation

type AnimeMediaRelation struct {
	ProviderID string                 `msgpack:"providerID,omitempty" json:"providerID,omitempty"`
	Type       enum.AnimeRelationType `msgpack:"type,omitempty" json:"type,omitempty"`
}

AnimeMediaRelation defines relationships with the media, such as prequels and sequals.

type AnimeMediaStudio

type AnimeMediaStudio struct {
	ID   *string `msgpack:"id,omitempty" json:"id,omitempty"`
	Name string  `msgpack:"name,omitempty" json:"name,omitempty"`
}

AnimeMediaStudio was created rather than having the value as a string it'll be it's own model in-case we would like to add future properties.

type AnimeMediaTag

type AnimeMediaTag struct {
	ID          *string `msgpack:"id,omitempty" json:"id,omitempty"`
	Name        string  `msgpack:"name,omitempty" json:"name,omitempty"`
	Description *string `msgpack:"description,omitempty" json:"description,omitempty"`
}

AnimeMediaTag was created rather than having the value as a string it'll be it's own model in-case we would like to add future properties.

type AnimeMediaTitle

type AnimeMediaTitle struct {
	Name      string              `msgpack:"name,omitempty" json:"name,omitempty"`
	Language  *string             `msgpack:"language,omitempty" json:"language,omitempty"`
	TitleType enum.AnimeTitleType `msgpack:"titleType,omitempty" json:"titleType,omitempty"`
}

AnimeMediaTitle defines a title and it's type for this media along with an optional language if available.

type BaseAnimeMedia

type BaseAnimeMedia struct {
	// Provider the kind of provider where the data was retrieved from.
	Provider enum.AnimeProvider `msgpack:"provider,omitempty" json:"provider,omitempty"`

	// ProviderID is the external identifier used by the provider
	// to identify the anime on their end.
	ProviderID string `msgpack:"providerID,omitempty" json:"providerID,omitempty"`
}

type CreateAnimeContext

type CreateAnimeContext struct {
	IsNew  bool               `json:"isNew,omitempty"`
	Entity *sqlc.Anime        `json:"entity,omitempty"`
	Media  *AnimeMedia        `json:"media,omitempty"`
	Images []*AnimeMediaImage `json:"images,omitempty"`
}

func (*CreateAnimeContext) AreImagesChanged

func (c *CreateAnimeContext) AreImagesChanged() bool

func (*CreateAnimeContext) ImageByReference

func (c *CreateAnimeContext) ImageByReference(reference string) *AnimeMediaImage

func (*CreateAnimeContext) ImageByURL

func (c *CreateAnimeContext) ImageByURL(url string) *AnimeMediaImage

func (*CreateAnimeContext) URLs

func (c *CreateAnimeContext) URLs() []string

type CreateAnimeResult

type CreateAnimeResult struct {
	Updated  []uuid.UUID `json:"updated,omitempty"`
	Inserted []uuid.UUID `json:"inserted,omitempty"`
}

type Genre

type Genre struct {
	ID   uuid.UUID `msgpack:"id,omitempty" json:"id,omitempty"`
	Name string    `msgpack:"name,omitempty" json:"name,omitempty"`
	Slug string    `msgpack:"slug,omitempty" json:"slug,omitempty"`
}

type GenresSortByName

type GenresSortByName []*Genre

func (GenresSortByName) Len

func (sbn GenresSortByName) Len() int

func (GenresSortByName) Less

func (sbn GenresSortByName) Less(i, j int) bool

func (GenresSortByName) Swap

func (sbn GenresSortByName) Swap(i, j int)

type MappingGroup

type MappingGroup struct {
	ID    uuid.UUID     `msgpack:"id,omitempty" json:"id,omitempty"`
	Nodes []MappingNode `msgpack:"nodes,omitempty" json:"nodes,omitempty"`
}

type MappingNode

type MappingNode struct {
	Provider   enum.AnimeProvider `msgpack:"provider,omitempty" json:"provider,omitempty"`
	ProviderID string             `msgpack:"providerID,omitempty" json:"providerID,omitempty"`
}

type PopulateMappingResult

type PopulateMappingResult struct {
	Updated map[string]int64 `json:"updated,omitempty"`
}

type RefreshAnime

type RefreshAnime struct{}

type RefreshAnimeAggregatorAggregateResult

type RefreshAnimeAggregatorAggregateResult struct {
	Animes      []*AggregatedAnime `json:"animes,omitempty"`
	Tags        []*Tag             `json:"tags,omitempty"`
	Genres      []*Genre           `json:"genres,omitempty"`
	Studios     []*Studio          `json:"studios,omitempty"`
	SeasonYears []int              `json:"seasonYears,omitempty"`
	Titles      []*TitleBase       `json:"titles,omitempty"`
	Seasons     []enum.Season      `json:"seasons,omitempty"`
	Formats     []enum.Format      `json:"formats,omitempty"`
	Statuses    []enum.Status      `json:"statuses,omitempty"`
}

type RefreshAnimeAggregatorContext

type RefreshAnimeAggregatorContext struct {
	Animes map[uuid.UUID][]*sqlc.ListAnimeWithMappingsRow `json:"animes,omitempty"`

	Titles          map[uuid.UUID][]*sqlc.AnimeTitle            `json:"titles,omitempty"`
	Relations       map[uuid.UUID][]*sqlc.VwAnimeRelation       `json:"relations,omitempty"`
	Recommendations map[uuid.UUID][]*sqlc.VwAnimeRecommendation `json:"recommendations,omitempty"`

	Genres  map[uuid.UUID]*sqlc.Genre  `json:"genres,omitempty"`
	Studios map[uuid.UUID]*sqlc.Studio `json:"studios,omitempty"`
	Tags    map[uuid.UUID]*sqlc.Tag    `json:"tags,omitempty"`
}

func (RefreshAnimeAggregatorContext) Aggregate

type RefreshMappings

type RefreshMappings struct {
	Updated map[string]int64 `json:"updated,omitempty"`
}

type RefreshMaterializedView

type RefreshMaterializedView struct{}

type RefreshTitles

type RefreshTitles struct{}

type SortTitleByScore

type SortTitleByScore []*TitleSearch

func (SortTitleByScore) Len

func (t SortTitleByScore) Len() int

func (SortTitleByScore) Less

func (t SortTitleByScore) Less(i, j int) bool

func (SortTitleByScore) Swap

func (t SortTitleByScore) Swap(i, j int)

type Studio

type Studio struct {
	ID   uuid.UUID `msgpack:"id,omitempty" json:"id,omitempty"`
	Name string    `msgpack:"name,omitempty" json:"name,omitempty"`
	Slug string    `msgpack:"slug,omitempty" json:"slug,omitempty"`
}

type StudiosSortByName

type StudiosSortByName []*Studio

func (StudiosSortByName) Len

func (sbn StudiosSortByName) Len() int

func (StudiosSortByName) Less

func (sbn StudiosSortByName) Less(i, j int) bool

func (StudiosSortByName) Swap

func (sbn StudiosSortByName) Swap(i, j int)

type Tag

type Tag struct {
	ID          uuid.UUID `msgpack:"id,omitempty" json:"id,omitempty"`
	Name        string    `msgpack:"name,omitempty" json:"name,omitempty"`
	Slug        string    `msgpack:"slug,omitempty" json:"slug,omitempty"`
	Description *string   `msgpack:"description,omitempty" json:"description,omitempty"`
}

type TagsSortByName

type TagsSortByName []*Tag

func (TagsSortByName) Len

func (sbn TagsSortByName) Len() int

func (TagsSortByName) Less

func (sbn TagsSortByName) Less(i, j int) bool

func (TagsSortByName) Swap

func (sbn TagsSortByName) Swap(i, j int)

type Title

type Title struct {
	ID        uuid.UUID           `msgpack:"id,omitempty" json:"id,omitempty"`
	AnimeID   uuid.UUID           `msgpack:"animeID,omitempty" json:"animeID,omitempty"`
	Name      string              `msgpack:"name,omitempty" json:"name,omitempty"`
	TitleType enum.AnimeTitleType `msgpack:"titleType,omitempty" json:"titleType,omitempty"`
	Language  *string             `msgpack:"language,omitempty" json:"language,omitempty"`
}

Title is an aggregated title whose ID is the anime mapping linked to the aggregated anime and the name.

type TitleBase

type TitleBase struct {
	ID   uuid.UUID `msgpack:"id,omitempty" json:"id,omitempty"`
	Name string    `msgpack:"name,omitempty" json:"name,omitempty"`
	Slug string    `msgpack:"slug,omitempty" json:"-"`
}

Titles is a representation of `[]*Title` which implements sort.Interface by sorting via `.Slug`

type TitleSearch

type TitleSearch struct {
	Title *TitleBase `msgpack:"title,omitempty" json:"title,omitempty"`
	Score float64    `msgpack:"score,omitempty" json:"score,omitempty"`
}

type Titles

type Titles []*Title

Titles is a representation of `[]*Title` which implements sort.Interface by sorting via `.Name`

func (Titles) Len

func (t Titles) Len() int

func (Titles) Less

func (t Titles) Less(i, j int) bool

func (Titles) Swap

func (t Titles) Swap(i, j int)

type TitlesBase

type TitlesBase []*TitleBase

func (TitlesBase) Len

func (t TitlesBase) Len() int

func (TitlesBase) Less

func (t TitlesBase) Less(i, j int) bool

func (TitlesBase) Swap

func (t TitlesBase) Swap(i, j int)

type UpdateAnimeReport

type UpdateAnimeReport struct {
	ProviderID string                   `json:"providerID,omitempty"`
	Provider   enum.AnimeProvider       `json:"provider,omitempty"`
	Items      []*UpdateAnimeReportItem `json:"items,omitempty"`
}

type UpdateAnimeReportItem

type UpdateAnimeReportItem struct {
	Property enum.UpdateAnimeReportProperty `json:"property,omitempty"`
	Before   any                            `json:"before,omitempty"`
	After    any                            `json:"after,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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