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)
- type AuthTokenizer
- type Clock
- type MultipartFileProvider
- type MultipartFileWrapper
- type RealClock
- type SiteService
- func (s *SiteService) CreateFixFirstStep(ctx context.Context, uid int64, c *types.CreateFixFirstStep) (int64, error)
- func (s *SiteService) DeleteUserSessions(ctx context.Context, uid int64) (int64, error)
- func (s *SiteService) GetBasePageData(ctx context.Context) (*types.BasePageData, error)
- func (s *SiteService) GetCurationImage(ctx context.Context, ciid int64) (*types.CurationImage, error)
- func (s *SiteService) GetFixByID(ctx context.Context, fid int64) (*types.Fix, error)
- func (s *SiteService) GetFixesFiles(ctx context.Context, ffids []int64) ([]*types.FixesFile, error)
- func (s *SiteService) GetFlashfreezeRootFile(ctx context.Context, fid int64) (*types.FlashfreezeFile, error)
- func (s *SiteService) GetNextSubmission(ctx context.Context, sid int64) (*int64, 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) GetSearchFixesData(ctx context.Context, filter *types.FixesFilter) (*types.SearchFixesPageData, error)
- func (s *SiteService) GetSearchFlashfreezeData(ctx context.Context, filter *types.FlashfreezeFilter) (*types.SearchFlashfreezePageData, 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) GetUIDFromSession(ctx context.Context, key string) (int64, bool, 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) GetViewFixPageData(ctx context.Context, fid int64) (*types.ViewFixPageData, 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) 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) ReceiveFixesChunk(ctx context.Context, fixID int64, resumableParams *types.ResumableParams, ...) 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) RunNotificationConsumer(logger *logrus.Entry, ctx context.Context, wg *sync.WaitGroup)
- func (s *SiteService) SaveUser(ctx context.Context, discordUser *types.DiscordUser) (*authToken, error)
- func (s *SiteService) SearchSubmissions(ctx context.Context, filter *types.SubmissionsFilter) ([]*types.ExtendedSubmission, int64, 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) 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
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
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 // contains filtered or unexported fields }
func New ¶
func New(l *logrus.Entry, db *sql.DB, authBotSession, notificationBotSession *discordgo.Session, flashpointServerID, notificationChannelID, curationFeedChannelID, validatorServerURL string, sessionExpirationSeconds int64, submissionsDir, submissionImagesDir, flashfreezeDir string, isDev bool, rsu *resumableuploadservice.ResumableUploadService, archiveIndexerServerURL, flashfreezeIngestDir, fixesDir string) *SiteService
func (*SiteService) CreateFixFirstStep ¶
func (s *SiteService) CreateFixFirstStep(ctx context.Context, uid int64, c *types.CreateFixFirstStep) (int64, error)
func (*SiteService) DeleteUserSessions ¶
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) GetCurationImage ¶
func (s *SiteService) GetCurationImage(ctx context.Context, ciid int64) (*types.CurationImage, error)
func (*SiteService) GetFixByID ¶
func (*SiteService) GetFixesFiles ¶
func (*SiteService) GetFlashfreezeRootFile ¶
func (s *SiteService) GetFlashfreezeRootFile(ctx context.Context, fid int64) (*types.FlashfreezeFile, error)
func (*SiteService) GetNextSubmission ¶
func (*SiteService) GetPreviousSubmission ¶
func (*SiteService) GetProfilePageData ¶
func (s *SiteService) GetProfilePageData(ctx context.Context, uid int64) (*types.ProfilePageData, error)
func (*SiteService) GetSearchFixesData ¶
func (s *SiteService) GetSearchFixesData(ctx context.Context, filter *types.FixesFilter) (*types.SearchFixesPageData, error)
func (*SiteService) GetSearchFlashfreezeData ¶
func (s *SiteService) GetSearchFlashfreezeData(ctx context.Context, filter *types.FlashfreezeFilter) (*types.SearchFlashfreezePageData, 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) GetUIDFromSession ¶
func (*SiteService) GetUserRoles ¶
func (*SiteService) GetUserStatistics ¶
func (s *SiteService) GetUserStatistics(ctx context.Context, uid int64) (*types.UserStatistics, error)
func (*SiteService) GetViewFixPageData ¶
func (s *SiteService) GetViewFixPageData(ctx context.Context, fid int64) (*types.ViewFixPageData, 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) 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) ReceiveFixesChunk ¶
func (s *SiteService) ReceiveFixesChunk(ctx context.Context, fixID int64, resumableParams *types.ResumableParams, chunk []byte) error
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) RunNotificationConsumer ¶
func (*SiteService) SaveUser ¶
func (s *SiteService) SaveUser(ctx context.Context, discordUser *types.DiscordUser) (*authToken, error)
func (*SiteService) SearchSubmissions ¶
func (s *SiteService) SearchSubmissions(ctx context.Context, filter *types.SubmissionsFilter) ([]*types.ExtendedSubmission, int64, error)
func (*SiteService) SoftDeleteComment ¶
func (*SiteService) SoftDeleteSubmission ¶
func (*SiteService) SoftDeleteSubmissionFile ¶
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)
Click to show internal directories.
Click to hide internal directories.