Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Guess ¶
type Guess interface {
CountFromDate(ctx context.Context, from time.Time) (int, error)
FindLatest(ctx context.Context) ([]domain.Guess, error)
FindByUser(ctx context.Context, userId, limit, page int) (domain.Paged[domain.Guess], error)
FindById(ctx context.Context, id string) (domain.Guess, error)
FindTopFromDate(ctx context.Context, from time.Time, limit int) ([]domain.GuessExtended, error)
CreateAndUpdateUserElo(ctx context.Context, userId int, input domain.GuessCreate) (int, domain.Guess, error)
}
type Players ¶
type Replays ¶ added in v0.11.0
type Replays interface {
AnonymizeAndPresign(ctx context.Context, data []byte, filename string, ttl time.Duration) (string, error)
CreateAndPresign(ctx context.Context, data []byte, size int64, filename string, ttl time.Duration) (string, error)
CreateForSubmission(ctx context.Context, data []byte, size int64, scoreId int) error
PresignSubmission(ctx context.Context, scoreId int, ttl time.Duration) (string, error)
}
type Rooms ¶
type Rooms interface {
FindByUserUnguessed(ctx context.Context, userId int) (domain.Room, error)
FindRandomScore(ctx context.Context, accessToken string) (osuapi.Score, error)
FindByUser(ctx context.Context, userId int, accessToken string) (domain.RoomExtended, error)
FindOrDeleteExpired(ctx context.Context, id, accessToken string, userId int) (domain.RoomExtended, error)
UpdateGuessID(ctx context.Context, id string, guessId string) error
UpdateReplayURL(ctx context.Context, id string, replayURL string) error
SetNext(ctx context.Context, id string, userId, playerId, scoreId int) (refill domain.RefillResult, room domain.Room, err error)
Create(ctx context.Context, playerId, userId, scoreId int, kind domain.RoomKind) (domain.RefillResult, domain.Room, error)
DeleteById(ctx context.Context, id string) error
DeleteByUser(ctx context.Context, userId int) error
DeleteByUserUnguessed(ctx context.Context, userId int) error
RefillForUser(ctx context.Context, userId int, sub uint) (domain.RefillResult, error)
// works for now, but should be moved to a separate service
GetScore(ctx context.Context, accessToken string, scoreId int) (osuapi.Score, error)
}
type Sessions ¶
type Sessions interface {
Find(ctx context.Context, id string) (domain.Session, error)
FindWithUser(ctx context.Context, id string) (domain.SessionExtended, error)
DeleteByUser(ctx context.Context, osuId int) error
UpdateTokens(ctx context.Context, id, accessToken, refreshToken string, expiresAt time.Time) error
Create(ctx context.Context, osuId int, accessToken, refreshToken string, expiresAt time.Time) (domain.Session, error)
}
type Submissions ¶
type Submissions interface {
Create(ctx context.Context, input domain.SubmissionCreate) (domain.Submission, error)
Delete(ctx context.Context, id string) error
SetAccepted(ctx context.Context, id string) error
FindRandom(ctx context.Context, userId int) (domain.Submission, error)
FindRandomWithScore(ctx context.Context, userId int, accessToken string) (osuapi.Score, string, error)
FindByUser(ctx context.Context, userId int, accepted bool) ([]domain.Submission, error)
FindByID(ctx context.Context, id string) (domain.Submission, error)
FindByScoreID(ctx context.Context, scoreId int) (domain.Submission, error)
Find(ctx context.Context, accepted bool, limit, page int) ([]domain.SubmissionExtended, error)
}
func NewSubmissions ¶
func NewSubmissions(repo repo.Submissions, client *osuapi.Client) Submissions
Click to show internal directories.
Click to hide internal directories.