Documentation ¶
Index ¶
- type AuthCallback
- type GetAgenciesRequest
- type GetVideosRequest
- type GetVtuberBloodTypeCountRequest
- type GetVtuberDesignerCountRequest
- type GetVtuberSubscriberCountRequest
- type GetVtuberVideoCountRequest
- type GetVtuberVideoDurationRequest
- type GetVtubersRequest
- type JWTClaim
- type Service
- type Token
- type User
- type VtuberOverriddenField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthCallback ¶ added in v0.18.0
type AuthCallback struct {
Code string `json:"code" validate:"required"`
}
AuthCallback is auth callback data.
type GetAgenciesRequest ¶ added in v0.14.0
type GetAgenciesRequest struct { Sort string `validate:"oneof=name -name member -member subscriber -subscriber" mod:"default=name,trim,lcase"` Page int `validate:"required,gte=1" mod:"default=1"` Limit int `validate:"required,gte=-1" mod:"default=20"` }
GetAgenciesRequest is get agencies request model.
type GetVideosRequest ¶ added in v0.27.0
type GetVideosRequest struct { StartDate string `validate:"omitempty,datetime=2006-01-02T15:04:05Z07:00"` EndDate string `validate:"omitempty,datetime=2006-01-02T15:04:05Z07:00"` IsFinished *bool `` Sort string `validate:"oneof=video_start_date -video_start_date" mod:"default=-video_start_date,trim,lcase"` Page int `validate:"required,gte=1" mod:"default=1"` Limit int `validate:"required,gte=-1" mod:"default=20"` }
GetVideosRequest is get videos request model.
type GetVtuberBloodTypeCountRequest ¶ added in v0.14.0
type GetVtuberBloodTypeCountRequest struct {
Top int `validate:"required,gte=-1" mod:"default=5"`
}
GetVtuberBloodTypeCountRequest is get vtuber blood type count request.
type GetVtuberDesignerCountRequest ¶ added in v0.14.0
type GetVtuberDesignerCountRequest struct {
Top int `validate:"required,gte=-1" mod:"default=10"`
}
GetVtuberDesignerCountRequest is get vtuber designer count request.
type GetVtuberSubscriberCountRequest ¶ added in v0.14.0
type GetVtuberSubscriberCountRequest struct { Interval int `validate:"required,gte=10000" mod:"default=100000"` Max int `validate:"required,lte=5000000" mod:"default=5000000"` }
GetVtuberSubscriberCountRequest is get vtuber subscriber count request.
type GetVtuberVideoCountRequest ¶ added in v0.14.0
type GetVtuberVideoCountRequest struct {
Top int `validate:"required,gte=-1" mod:"default=10"`
}
GetVtuberVideoCountRequest is get vtuber video count request.
type GetVtuberVideoDurationRequest ¶ added in v0.14.0
type GetVtuberVideoDurationRequest struct {
Top int `validate:"required,gte=-1" mod:"default=10"`
}
GetVtuberVideoDurationRequest is get vtuber video duration request.
type GetVtubersRequest ¶ added in v0.5.0
type GetVtubersRequest struct { Mode entity.SearchMode `validate:"oneof=all simple" mod:"default=all,trim,lcase"` Names string `validate:"omitempty,gte=3" mod:"trim,lcase"` Name string `validate:"omitempty,gte=3" mod:"trim,lcase"` OriginalName string `validate:"omitempty,gte=3" mod:"trim,lcase"` Nickname string `validate:"omitempty,gte=3" mod:"trim,lcase"` ExcludeActive bool `` ExcludeRetired bool `` DebutDay int `validate:"omitempty,gte=1"` StartDebutMonth int `validate:"omitempty,gte=1"` EndDebutMonth int `validate:"omitempty,gte=1"` StartDebutYear int `validate:"omitempty,gte=1"` EndDebutYear int `validate:"omitempty,gte=1"` StartRetiredMonth int `validate:"omitempty,gte=1"` EndRetiredMonth int `validate:"omitempty,gte=1"` StartRetiredYear int `validate:"omitempty,gte=1"` EndRetiredYear int `validate:"omitempty,gte=1"` Has2D *bool `` Has3D *bool `` CharacterDesigner string `mod:"trim"` Character2DModeler string `mod:"trim"` Character3DModeler string `mod:"trim"` InAgency *bool `` Agency string `mod:"trim"` AgencyID int64 `validate:"omitempty,gte=1"` LanguageID int64 `validate:"omitempty,gte=1"` ChannelTypes []entity.ChannelType `validate:"dive,gte=1" mod:"dive,trim"` BirthdayDay int `validate:"omitempty,gte=1"` StartBirthdayMonth int `validate:"omitempty,gte=1"` EndBirthdayMonth int `validate:"omitempty,gte=1"` BloodTypes []string `validate:"dive,gte=1" mod:"dive,trim"` Genders []string `validate:"dive,gte=1" mod:"dive,trim"` Zodiacs []string `validate:"dive,gte=1" mod:"dive,trim"` StartSubscriber int `validate:"omitempty,gte=1"` EndSubscriber int `validate:"omitempty,gte=1"` StartVideoCount int `validate:"omitempty,gte=1"` EndVideoCount int `validate:"omitempty,gte=1"` Sort string `` /* 200-byte string literal not displayed */ Page int `validate:"required,gte=1" mod:"default=1"` Limit int `validate:"required,gte=-1" mod:"default=20"` }
GetVtubersRequest is get vtubers request model.
type JWTClaim ¶ added in v0.18.0
type JWTClaim struct { UserID int64 `json:"user_id"` Username string `json:"username"` IsAdmin bool `json:"is_admin"` AccessUUID string `json:"-"` RefreshUUID string `json:"-"` }
JWTClaim is jwt claim.
type Service ¶
type Service interface { HandleAuthCallback(ctx context.Context, data AuthCallback) (*Token, int, error) ValidateToken(ctx context.Context, uuid string, userID int64) (int, error) InvalidateToken(ctx context.Context, uuid string) (int, error) RefreshToken(ctx context.Context, data JWTClaim) (string, int, error) GetProfile(ctx context.Context, userID int64) (*User, int, error) GetVtubers(ctx context.Context, params GetVtubersRequest) ([]vtuber, *pagination, int, error) GetVtuberByID(ctx context.Context, id int64) (*vtuber, int, error) GetVtuberImages(ctx context.Context, shuffle bool, limit int) ([]vtuberImage, int, error) GetVtuberFamilyTrees(ctx context.Context) (*vtuberFamilyTree, int, error) GetVtuberAgencyTrees(ctx context.Context) (*vtuberAgencyTree, int, error) GetVtuberCharacterDesigners(ctx context.Context) ([]string, int, error) GetVtuberCharacter2DModelers(ctx context.Context) ([]string, int, error) GetVtuberCharacter3DModelers(ctx context.Context) ([]string, int, error) GetVtuberCount(ctx context.Context) (int, int, error) GetVtuberAverageActiveTime(ctx context.Context) (float64, int, error) GetVtuberStatusCount(ctx context.Context) (*vtuberStatusCount, int, error) GetVtuberDebutRetireCountMonthly(ctx context.Context) ([]vtuberDebutRetireCount, int, error) GetVtuberDebutRetireCountYearly(ctx context.Context) ([]vtuberDebutRetireCount, int, error) GetVtuberModelCount(ctx context.Context) (*vtuberModelCount, int, error) GetVtuberInAgencyCount(ctx context.Context) (*vtuberInAgencyCount, int, error) GetVtuberSubscriberCount(ctx context.Context, params GetVtuberSubscriberCountRequest) ([]vtuberSubscriberCount, int, error) GetVtuberDesignerCount(ctx context.Context, params GetVtuberDesignerCountRequest) ([]vtuberDesignerCount, int, error) GetVtuber2DModelerCount(ctx context.Context, params GetVtuberDesignerCountRequest) ([]vtuberDesignerCount, int, error) GetVtuber3DModelerCount(ctx context.Context, params GetVtuberDesignerCountRequest) ([]vtuberDesignerCount, int, error) GetVtuberAverageVideoCount(ctx context.Context) (float64, int, error) GetVtuberAverageVideoDuration(ctx context.Context) (float64, int, error) GetVtuberVideoCountByDate(ctx context.Context, hourly, daily bool) ([]vtuberVideoCountByDate, int, error) GetVtuberVideoCount(ctx context.Context, params GetVtuberVideoCountRequest) ([]vtuberVideoCount, int, error) GetVtuberVideoDuration(ctx context.Context, params GetVtuberVideoDurationRequest) ([]vtuberVideoDuration, int, error) GetVtuberBirthdayCount(ctx context.Context) ([]vtuberBirthdayCount, int, error) GetVtuberAverageHeight(ctx context.Context) (float64, int, error) GetVtuberAverageWeight(ctx context.Context) (float64, int, error) GetVtuberBloodTypeCount(ctx context.Context, params GetVtuberBloodTypeCountRequest) ([]vtuberBloodTypeCount, int, error) GetVtuberChannelTypeCount(ctx context.Context) ([]vtuberChannelTypeCount, int, error) GetVtuberLanguageCount(ctx context.Context) ([]vtuberLanguageCount, int, error) GetVtuberGenderCount(ctx context.Context) ([]vtuberGenderCount, int, error) GetVtuberZodiacCount(ctx context.Context) ([]vtuberZodiacCount, int, error) GetAgencies(ctx context.Context, params GetAgenciesRequest) ([]agency, *pagination, int, error) GetAgencyByID(ctx context.Context, id int64) (*agency, int, error) GetAgencyCount(ctx context.Context) (int, int, error) GetVideos(ctx context.Context, params GetVideosRequest) ([]video, *pagination, int, error) GetLanguages(ctx context.Context) ([]language, *pagination, int, error) GetWikiaImage(ctx context.Context, path string) ([]byte, int, error) DeleteVtuberByID(ctx context.Context, id int64) (int, error) ParseVtuberByID(ctx context.Context, id int64) (int, error) GetVtuberOverriddenFieldByID(ctx context.Context, id int64) (*VtuberOverriddenField, int, error) UpdateVtuberOverriddenFieldByID(ctx context.Context, data VtuberOverriddenField) (int, error) ConsumeMessage(ctx context.Context, msg entity.Message) error QueueMissingAgency(ctx context.Context, limit int) (int, int, error) QueueMissingVtuber(ctx context.Context, limit int) (int, int, error) QueueMissingLanguage(ctx context.Context, limit int) (int, int, error) QueueOldAgency(ctx context.Context, limit int) (int, int, error) QueueOldActiveVtuber(ctx context.Context, limit int) (int, int, error) QueueOldRetiredVtuber(ctx context.Context, limit int) (int, int, error) }
Service contains functions for service.
func New ¶
func New( wikia wikiaRepository.Repository, vtuber vtuberRepository.Repository, nonVtuber nonVtuberRepository.Repository, agency agencyRepository.Repository, language languageRepository.Repository, channelStatsHistory channelStatsHistoryRepository.Repository, publisher publisherRepository.Repository, youtube youtubeRepository.Repository, twitch twitchRepository.Repository, bilibili bilibilRepository.Repository, niconico niconicoRepository.Repository, sso ssoRepository.Repository, user userRepository.Repository, token tokenRepository.Repository, ) Service
New to create new service.
type Token ¶ added in v0.18.0
type Token struct { AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` }
Token is access & refresh token.
type VtuberOverriddenField ¶ added in v0.20.0
type VtuberOverriddenField struct { ID int64 `json:"-" validate:"required,gte=1"` DebutDate overriddenDate `json:"debut_date"` RetirementDate overriddenDate `json:"retirement_date"` Agencies overriddenAgencies `json:"agencies"` Affiliations overriddenAffiliations `json:"affiliations"` Channels overriddenChannels `json:"channels"` }
VtuberOverriddenField is vtuber overridden field model.