Documentation ¶
Index ¶
- func MapAuthToken(token *authToken) map[string]string
- func NewAuthTokenProvider() *authTokenProvider
- func NewValidator(validatorServerURL string) *curationValidator
- func ParseAuthToken(value map[string]string) (*authToken, error)
- func RemoveRepackFolder(ctx context.Context, filePath string)
- type AuthTokenizer
- type Clock
- type MultipartFileProvider
- type MultipartFileWrapper
- type RealClock
- type SiteService
- func (s *SiteService) AddSubmissionToFlashpoint(ctx context.Context, submission *types.ExtendedSubmission, ...) (*string, error)
- func (s *SiteService) DeleteGame(ctx context.Context, gameId string, reason string, imagesPath string, ...) error
- func (s *SiteService) DeleteUserSessions(ctx context.Context, uid int64) (int64, error)
- func (s *SiteService) DeveloperImportDatabaseJson(ctx context.Context, data *types.LauncherDump) error
- func (s *SiteService) DeveloperTagDescFromValidator(ctx context.Context) error
- func (s *SiteService) FetchGames(ctx context.Context, ids []string) ([]*types.Game, error)
- func (s *SiteService) FreezeGame(ctx context.Context, gameId string, uid int64, dataPacksPath string, ...) error
- func (s *SiteService) FreezeSubmission(ctx context.Context, sid int64) error
- func (s *SiteService) GenAuthToken(ctx context.Context, uid int64, scope string, client string, ipAddr string) (map[string]string, error)
- func (s *SiteService) GetApplyContentPatchPageData(ctx context.Context, sid int64) (*types.ApplyContentPatchPageData, error)
- func (s *SiteService) GetBasePageData(ctx context.Context) (*types.BasePageData, error)
- func (s *SiteService) GetClientSecret(ctx context.Context, clientID string) (string, error)
- func (s *SiteService) GetCurationImage(ctx context.Context, ciid int64) (*types.CurationImage, error)
- func (s *SiteService) GetDeletedGamePageData(ctx context.Context, modifiedAfter *string) ([]*types.DeletedGame, error)
- func (s *SiteService) GetFlashfreezeRootFile(ctx context.Context, fid int64) (*types.FlashfreezeFile, error)
- func (s *SiteService) GetGameCountSinceDate(ctx context.Context, modifiedAfter *string) (int, error)
- func (s *SiteService) GetGameDataIndexPageData(ctx context.Context, gameId string, date int64) (*types.GameDataIndexPageData, error)
- func (s *SiteService) GetGameDataPageData(ctx context.Context, gameId string, date int64) (*types.GameDataPageData, error)
- func (s *SiteService) GetGamePageData(ctx context.Context, gameId string, imageCdn string, compressedImages bool, ...) (*types.GamePageData, error)
- func (s *SiteService) GetGamesPageData(ctx context.Context, modifierAfter *string, modifiedBefore *string, broad bool, ...) ([]*types.Game, []*types.AdditionalApp, []*types.GameData, [][]string, ...)
- func (s *SiteService) GetIndexMatchesHash(ctx context.Context, hashType string, hashStr string) (*types.IndexMatchResult, error)
- func (s *SiteService) GetMetadataStatsPageData(ctx context.Context) (*types.MetadataStatsPageData, error)
- func (s *SiteService) GetNextSubmission(ctx context.Context, sid int64) (*int64, error)
- func (s *SiteService) GetPlatformsPageData(ctx context.Context, modifiedAfter *string) (*types.PlatformsPageData, error)
- func (s *SiteService) GetPreviousSubmission(ctx context.Context, sid int64) (*int64, error)
- func (s *SiteService) GetProfilePageData(ctx context.Context, uid int64) (*types.ProfilePageData, error)
- func (s *SiteService) GetSearchFlashfreezeData(ctx context.Context, filter *types.FlashfreezeFilter) (*types.SearchFlashfreezePageData, error)
- func (s *SiteService) GetServerUser(ctx context.Context, uid int64) (*types.FlashpointDiscordUser, error)
- func (s *SiteService) GetSessionAuthInfo(ctx context.Context, key string) (*types.SessionInfo, bool, error)
- func (s *SiteService) GetSessions(ctx context.Context, uid int64) ([]*types.SessionInfo, error)
- func (s *SiteService) GetStatisticsPageData(ctx context.Context) (*types.StatisticsPageData, error)
- func (s *SiteService) GetSubmissionFiles(ctx context.Context, sfids []int64) ([]*types.SubmissionFile, error)
- func (s *SiteService) GetSubmissionsFilesPageData(ctx context.Context, sid int64) (*types.SubmissionsFilesPageData, error)
- func (s *SiteService) GetSubmissionsPageData(ctx context.Context, filter *types.SubmissionsFilter) (*types.SubmissionsPageData, error)
- func (s *SiteService) GetTagPageData(ctx context.Context, tagIdStr string) (*types.TagPageData, error)
- func (s *SiteService) GetTagsPageData(ctx context.Context, modifiedAfter *string) (*types.TagsPageData, error)
- func (s *SiteService) GetUserRoles(ctx context.Context, uid int64) ([]string, error)
- func (s *SiteService) GetUserStatistics(ctx context.Context, uid int64) (*types.UserStatistics, error)
- func (s *SiteService) GetUsers(ctx context.Context) ([]*types.User, error)
- func (s *SiteService) GetViewSubmissionPageData(ctx context.Context, uid, sid int64) (*types.ViewSubmissionPageData, error)
- func (s *SiteService) IndexUnindexedFlashfreezeItems(l *logrus.Entry)
- func (s *SiteService) IngestFlashfreezeItems(l *logrus.Entry)
- func (s *SiteService) IngestUnknownFlashfreezeItems(l *logrus.Entry)
- func (s *SiteService) IsChunkReceived(ctx context.Context, resumableParams *types.ResumableParams) (bool, error)
- func (s *SiteService) Logout(ctx context.Context, secret string) error
- func (s *SiteService) NukeSessionTable(ctx context.Context) error
- func (s *SiteService) OverrideBot(ctx context.Context, sid int64) error
- func (s *SiteService) ProduceRemindersAboutRequestedChanges(ctx context.Context) (int, error)
- func (s *SiteService) ReceiveComments(ctx context.Context, uid int64, sids []int64, ...) error
- func (s *SiteService) ReceiveFlashfreezeChunk(ctx context.Context, resumableParams *types.ResumableParams, chunk []byte) (*int64, error)
- func (s *SiteService) ReceiveSubmissionChunk(ctx context.Context, sid *int64, resumableParams *types.ResumableParams, ...) (*string, error)
- func (s *SiteService) RecomputeSubmissionCacheAll(ctx context.Context)
- func (s *SiteService) RestoreGame(ctx context.Context, gameId string, reason string, imagesPath string, ...) error
- func (s *SiteService) RevokeSession(ctx context.Context, uid int64, sessionID int64) error
- func (s *SiteService) RunNotificationConsumer(logger *logrus.Entry, ctx context.Context, wg *sync.WaitGroup)
- func (s *SiteService) SaveGame(ctx context.Context, game *types.Game) error
- func (s *SiteService) SaveGameData(ctx context.Context, gameId string, date int64, gameData *types.GameData) error
- func (s *SiteService) SaveTag(ctx context.Context, tag *types.Tag) error
- func (s *SiteService) SaveUser(ctx context.Context, discordUser *types.DiscordUser, scope string, ...) (*authToken, error)
- func (s *SiteService) SearchSubmissions(ctx context.Context, filter *types.SubmissionsFilter) ([]*types.ExtendedSubmission, int64, error)
- func (s *SiteService) SetClientAppSecret(ctx context.Context, clientID string, clientSecret string) error
- func (s *SiteService) SoftDeleteComment(ctx context.Context, cid int64, deleteReason string) error
- func (s *SiteService) SoftDeleteSubmission(ctx context.Context, sid int64, deleteReason string) error
- func (s *SiteService) SoftDeleteSubmissionFile(ctx context.Context, sfid int64, deleteReason string) error
- func (s *SiteService) UnfreezeGame(ctx context.Context, gameId string, uid int64, dataPacksPath string, ...) error
- func (s *SiteService) UnfreezeSubmission(ctx context.Context, sid int64) error
- func (s *SiteService) UpdateMasterDB(ctx context.Context) error
- func (s *SiteService) UpdateNotificationSettings(ctx context.Context, uid int64, notificationActions []string) error
- func (s *SiteService) UpdateSubscriptionSettings(ctx context.Context, uid, sid int64, subscribe bool) error
- type SubmissionStatusKeeper
- func (s *SubmissionStatusKeeper) Get(tempName string) *types.SubmissionStatus
- func (s *SubmissionStatusKeeper) SetCopying(tempName string, message string)
- func (s *SubmissionStatusKeeper) SetFailed(tempName, message string)
- func (s *SubmissionStatusKeeper) SetFinalizing(tempName string)
- func (s *SubmissionStatusKeeper) SetReceived(tempName string)
- func (s *SubmissionStatusKeeper) SetSuccess(tempName string, sid int64)
- func (s *SubmissionStatusKeeper) SetValidating(tempName string)
- type Validator
- type ZipIndexer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapAuthToken ¶
func NewAuthTokenProvider ¶
func NewAuthTokenProvider() *authTokenProvider
func NewValidator ¶
func NewValidator(validatorServerURL string) *curationValidator
func ParseAuthToken ¶
ParseAuthToken parses map into token
func RemoveRepackFolder ¶
Types ¶
type AuthTokenizer ¶
type MultipartFileProvider ¶
type MultipartFileWrapper ¶
type MultipartFileWrapper struct {
// contains filtered or unexported fields
}
func NewMutlipartFileWrapper ¶
func NewMutlipartFileWrapper(fileHeader *multipart.FileHeader) *MultipartFileWrapper
func (*MultipartFileWrapper) Filename ¶
func (m *MultipartFileWrapper) Filename() string
func (*MultipartFileWrapper) Size ¶
func (m *MultipartFileWrapper) Size() int64
type SiteService ¶
type SiteService struct { SSK SubmissionStatusKeeper DataPacksIndexer ZipIndexer // contains filtered or unexported fields }
func New ¶
func New(l *logrus.Entry, db *sql.DB, pgdb *pgxpool.Pool, authBotSession, notificationBotSession *discordgo.Session, flashpointServerID, notificationChannelID, curationFeedChannelID, validatorServerURL string, sessionExpirationSeconds int64, submissionsDir, submissionImagesDir, flashfreezeDir string, isDev bool, rsu *resumableuploadservice.ResumableUploadService, archiveIndexerServerURL, flashfreezeIngestDir, dataPacksDir string) *SiteService
func (*SiteService) AddSubmissionToFlashpoint ¶
func (*SiteService) DeleteGame ¶
func (*SiteService) DeleteUserSessions ¶
func (*SiteService) DeveloperImportDatabaseJson ¶
func (s *SiteService) DeveloperImportDatabaseJson(ctx context.Context, data *types.LauncherDump) error
func (*SiteService) DeveloperTagDescFromValidator ¶
func (s *SiteService) DeveloperTagDescFromValidator(ctx context.Context) error
func (*SiteService) FetchGames ¶
func (*SiteService) FreezeGame ¶
func (*SiteService) FreezeSubmission ¶
func (s *SiteService) FreezeSubmission(ctx context.Context, sid int64) error
func (*SiteService) GenAuthToken ¶
func (*SiteService) GetApplyContentPatchPageData ¶
func (s *SiteService) GetApplyContentPatchPageData(ctx context.Context, sid int64) (*types.ApplyContentPatchPageData, error)
func (*SiteService) GetBasePageData ¶
func (s *SiteService) GetBasePageData(ctx context.Context) (*types.BasePageData, error)
GetBasePageData loads base user data, does not return error if user is not logged in
func (*SiteService) GetClientSecret ¶
func (*SiteService) GetCurationImage ¶
func (s *SiteService) GetCurationImage(ctx context.Context, ciid int64) (*types.CurationImage, error)
func (*SiteService) GetDeletedGamePageData ¶
func (s *SiteService) GetDeletedGamePageData(ctx context.Context, modifiedAfter *string) ([]*types.DeletedGame, error)
func (*SiteService) GetFlashfreezeRootFile ¶
func (s *SiteService) GetFlashfreezeRootFile(ctx context.Context, fid int64) (*types.FlashfreezeFile, error)
func (*SiteService) GetGameCountSinceDate ¶
func (*SiteService) GetGameDataIndexPageData ¶
func (s *SiteService) GetGameDataIndexPageData(ctx context.Context, gameId string, date int64) (*types.GameDataIndexPageData, error)
func (*SiteService) GetGameDataPageData ¶
func (s *SiteService) GetGameDataPageData(ctx context.Context, gameId string, date int64) (*types.GameDataPageData, error)
func (*SiteService) GetGamePageData ¶
func (s *SiteService) GetGamePageData(ctx context.Context, gameId string, imageCdn string, compressedImages bool, revisionDate string) (*types.GamePageData, error)
func (*SiteService) GetGamesPageData ¶
func (*SiteService) GetIndexMatchesHash ¶
func (s *SiteService) GetIndexMatchesHash(ctx context.Context, hashType string, hashStr string) (*types.IndexMatchResult, error)
func (*SiteService) GetMetadataStatsPageData ¶
func (s *SiteService) GetMetadataStatsPageData(ctx context.Context) (*types.MetadataStatsPageData, error)
func (*SiteService) GetNextSubmission ¶
func (*SiteService) GetPlatformsPageData ¶
func (s *SiteService) GetPlatformsPageData(ctx context.Context, modifiedAfter *string) (*types.PlatformsPageData, error)
func (*SiteService) GetPreviousSubmission ¶
func (*SiteService) GetProfilePageData ¶
func (s *SiteService) GetProfilePageData(ctx context.Context, uid int64) (*types.ProfilePageData, error)
func (*SiteService) GetSearchFlashfreezeData ¶
func (s *SiteService) GetSearchFlashfreezeData(ctx context.Context, filter *types.FlashfreezeFilter) (*types.SearchFlashfreezePageData, error)
func (*SiteService) GetServerUser ¶
func (s *SiteService) GetServerUser(ctx context.Context, uid int64) (*types.FlashpointDiscordUser, error)
func (*SiteService) GetSessionAuthInfo ¶
func (s *SiteService) GetSessionAuthInfo(ctx context.Context, key string) (*types.SessionInfo, bool, error)
func (*SiteService) GetSessions ¶
func (s *SiteService) GetSessions(ctx context.Context, uid int64) ([]*types.SessionInfo, error)
func (*SiteService) GetStatisticsPageData ¶
func (s *SiteService) GetStatisticsPageData(ctx context.Context) (*types.StatisticsPageData, error)
func (*SiteService) GetSubmissionFiles ¶
func (s *SiteService) GetSubmissionFiles(ctx context.Context, sfids []int64) ([]*types.SubmissionFile, error)
func (*SiteService) GetSubmissionsFilesPageData ¶
func (s *SiteService) GetSubmissionsFilesPageData(ctx context.Context, sid int64) (*types.SubmissionsFilesPageData, error)
func (*SiteService) GetSubmissionsPageData ¶
func (s *SiteService) GetSubmissionsPageData(ctx context.Context, filter *types.SubmissionsFilter) (*types.SubmissionsPageData, error)
func (*SiteService) GetTagPageData ¶
func (s *SiteService) GetTagPageData(ctx context.Context, tagIdStr string) (*types.TagPageData, error)
func (*SiteService) GetTagsPageData ¶
func (s *SiteService) GetTagsPageData(ctx context.Context, modifiedAfter *string) (*types.TagsPageData, error)
func (*SiteService) GetUserRoles ¶
func (*SiteService) GetUserStatistics ¶
func (s *SiteService) GetUserStatistics(ctx context.Context, uid int64) (*types.UserStatistics, error)
func (*SiteService) GetViewSubmissionPageData ¶
func (s *SiteService) GetViewSubmissionPageData(ctx context.Context, uid, sid int64) (*types.ViewSubmissionPageData, error)
func (*SiteService) IndexUnindexedFlashfreezeItems ¶
func (s *SiteService) IndexUnindexedFlashfreezeItems(l *logrus.Entry)
func (*SiteService) IngestFlashfreezeItems ¶
func (s *SiteService) IngestFlashfreezeItems(l *logrus.Entry)
func (*SiteService) IngestUnknownFlashfreezeItems ¶
func (s *SiteService) IngestUnknownFlashfreezeItems(l *logrus.Entry)
func (*SiteService) IsChunkReceived ¶
func (s *SiteService) IsChunkReceived(ctx context.Context, resumableParams *types.ResumableParams) (bool, error)
func (*SiteService) NukeSessionTable ¶
func (s *SiteService) NukeSessionTable(ctx context.Context) error
NukeSessionTable nukes the session table
func (*SiteService) OverrideBot ¶
func (s *SiteService) OverrideBot(ctx context.Context, sid int64) error
func (*SiteService) ProduceRemindersAboutRequestedChanges ¶
func (s *SiteService) ProduceRemindersAboutRequestedChanges(ctx context.Context) (int, error)
ProduceRemindersAboutRequestedChanges generates notifications for every user with submissions which are waiting for changes more than a month
func (*SiteService) ReceiveComments ¶
func (*SiteService) ReceiveFlashfreezeChunk ¶
func (s *SiteService) ReceiveFlashfreezeChunk(ctx context.Context, resumableParams *types.ResumableParams, chunk []byte) (*int64, error)
func (*SiteService) ReceiveSubmissionChunk ¶
func (s *SiteService) ReceiveSubmissionChunk(ctx context.Context, sid *int64, resumableParams *types.ResumableParams, chunk []byte) (*string, error)
func (*SiteService) RecomputeSubmissionCacheAll ¶
func (s *SiteService) RecomputeSubmissionCacheAll(ctx context.Context)
func (*SiteService) RestoreGame ¶
func (*SiteService) RevokeSession ¶
func (*SiteService) RunNotificationConsumer ¶
func (*SiteService) SaveGameData ¶
func (*SiteService) SaveUser ¶
func (s *SiteService) SaveUser(ctx context.Context, discordUser *types.DiscordUser, scope string, clientID string, ipAddr string) (*authToken, error)
func (*SiteService) SearchSubmissions ¶
func (s *SiteService) SearchSubmissions(ctx context.Context, filter *types.SubmissionsFilter) ([]*types.ExtendedSubmission, int64, error)
func (*SiteService) SetClientAppSecret ¶
func (*SiteService) SoftDeleteComment ¶
func (*SiteService) SoftDeleteSubmission ¶
func (*SiteService) SoftDeleteSubmissionFile ¶
func (*SiteService) UnfreezeGame ¶
func (*SiteService) UnfreezeSubmission ¶
func (s *SiteService) UnfreezeSubmission(ctx context.Context, sid int64) error
func (*SiteService) UpdateMasterDB ¶
func (s *SiteService) UpdateMasterDB(ctx context.Context) error
func (*SiteService) UpdateNotificationSettings ¶
func (*SiteService) UpdateSubscriptionSettings ¶
type SubmissionStatusKeeper ¶
func (*SubmissionStatusKeeper) Get ¶
func (s *SubmissionStatusKeeper) Get(tempName string) *types.SubmissionStatus
func (*SubmissionStatusKeeper) SetCopying ¶
func (s *SubmissionStatusKeeper) SetCopying(tempName string, message string)
func (*SubmissionStatusKeeper) SetFailed ¶
func (s *SubmissionStatusKeeper) SetFailed(tempName, message string)
func (*SubmissionStatusKeeper) SetFinalizing ¶
func (s *SubmissionStatusKeeper) SetFinalizing(tempName string)
func (*SubmissionStatusKeeper) SetReceived ¶
func (s *SubmissionStatusKeeper) SetReceived(tempName string)
func (*SubmissionStatusKeeper) SetSuccess ¶
func (s *SubmissionStatusKeeper) SetSuccess(tempName string, sid int64)
func (*SubmissionStatusKeeper) SetValidating ¶
func (s *SubmissionStatusKeeper) SetValidating(tempName string)
type Validator ¶
type Validator interface { Validate(ctx context.Context, file io.Reader, filename string) (*types.ValidatorResponse, error) GetTags(ctx context.Context) ([]types.Tag, error) ProvideArchiveForValidation(filePath string) (*types.ValidatorResponse, error) ProvideArchiveForRepacking(filePath string) (*types.ValidatorRepackResponse, error) }
type ZipIndexer ¶
type ZipIndexer struct {
// contains filtered or unexported fields
}
func NewZipIndexer ¶
func (*ZipIndexer) GetStatus ¶
func (z *ZipIndexer) GetStatus() (string, error)
func (*ZipIndexer) Start ¶
func (z *ZipIndexer) Start()
func (*ZipIndexer) Stop ¶
func (z *ZipIndexer) Stop()
Click to show internal directories.
Click to hide internal directories.