Documentation
¶
Index ¶
- type Anime
- type AnimeGenre
- type AnimePicture
- type AnimeRelated
- type AnimeStatsHistory
- type AnimeStudio
- type SQL
- func (sql *SQL) DeleteByID(ctx context.Context, id int64) (int, error)
- func (sql *SQL) Get(ctx context.Context, data entity.GetRequest) ([]*entity.Anime, int, int, error)
- func (sql *SQL) GetByID(ctx context.Context, id int64) (*entity.Anime, int, error)
- func (sql *SQL) GetByIDs(ctx context.Context, ids []int64) ([]*entity.Anime, int, error)
- func (sql *SQL) GetHistories(ctx context.Context, data entity.GetHistoriesRequest) ([]entity.History, int, error)
- func (sql *SQL) GetIDs(ctx context.Context) ([]int64, int, error)
- func (sql *SQL) GetMaxID(ctx context.Context) (int64, int, error)
- func (sql *SQL) GetOldFinishedIDs(ctx context.Context) ([]int64, int, error)
- func (sql *SQL) GetOldNotYetIDs(ctx context.Context) ([]int64, int, error)
- func (sql *SQL) GetOldReleasingIDs(ctx context.Context) ([]int64, int, error)
- func (sql *SQL) GetRelatedByIDs(ctx context.Context, ids []int64) ([]*entity.AnimeRelated, int, error)
- func (sql *SQL) IsOld(ctx context.Context, id int64) (bool, int, error)
- func (sql *SQL) Update(ctx context.Context, data entity.Anime) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Anime ¶
type Anime struct {
ID int64 `gorm:"primaryKey"`
Title string
TitleSynonym string
TitleEnglish string
TitleJapanese string
Picture string
StartDay int
StartMonth int
StartYear int
EndDay int
EndMonth int
EndYear int
Synopsis string
NSFW bool
Type entity.Type
Status entity.Status
Episode int
EpisodeDuration int // in seconds
Season entity.Season
SeasonYear int
BroadcastDay entity.Day
BroadcastTime string
Source entity.Source
Rating entity.Rating
Background string
// Stats.
Mean float64
Rank int
Popularity int
Member int
Voter int
UserWatching int
UserCompleted int
UserOnHold int
UserDropped int
UserPlanned int
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt
}
Anime is anime database model.
type AnimeGenre ¶
AnimeGenre is anime_genre database model.
type AnimePicture ¶
AnimePicture is anime_picture database model.
type AnimeRelated ¶
type AnimeRelated struct {
AnimeID1 int64 `gorm:"primaryKey"`
AnimeID2 int64 `gorm:"primaryKey"`
Relation entity.Relation `gorm:"primaryKey"`
}
AnimeRelated is anime_related database model.
type AnimeStatsHistory ¶
type AnimeStatsHistory struct {
ID int64
AnimeID int64 `gorm:"index"`
Mean float64
Rank int
Popularity int
Member int
Voter int
UserWatching int
UserCompleted int
UserOnHold int
UserDropped int
UserPlanned int
CreatedAt time.Time
}
AnimeStatsHistory is anime_stats_history database model.
type AnimeStudio ¶
AnimeStudio is anime_studio database model.
type SQL ¶
type SQL struct {
// contains filtered or unexported fields
}
SQL contains functions for anime sql database.
func (*SQL) DeleteByID ¶ added in v0.3.2
DeleteByID to delete by id.
func (*SQL) GetHistories ¶ added in v0.9.0
func (sql *SQL) GetHistories(ctx context.Context, data entity.GetHistoriesRequest) ([]entity.History, int, error)
GetHistories to get histories.
func (*SQL) GetOldFinishedIDs ¶
GetOldFinishedIDs to get old finished anime ids.
func (*SQL) GetOldNotYetIDs ¶
GetOldNotYetIDs to get old not yet released anime ids.
func (*SQL) GetOldReleasingIDs ¶
GetOldReleasingIDs to get old releasing anime ids.
func (*SQL) GetRelatedByIDs ¶ added in v0.3.0
func (sql *SQL) GetRelatedByIDs(ctx context.Context, ids []int64) ([]*entity.AnimeRelated, int, error)
GetRelatedByIDs to get related anime by ids.
Click to show internal directories.
Click to hide internal directories.