Documentation ¶
Index ¶
- func CreatePuzzlesFromGame(ctx context.Context, eqLossLimit uint32, ...) ([]*macondopb.PuzzleCreationResponse, error)
- func Generate(ctx context.Context, cfg *config.Config, gs gameplay.GameStore, ps PuzzleStore, ...) (int, error)
- func GetAnswer(ctx context.Context, ps PuzzleStore, puzzleUUID string) (*macondopb.GameEvent, string, int32, string, *ipc.GameRequest, ...)
- func GetJobInfo(ctx context.Context, ps PuzzleStore, genId int) (time.Time, time.Time, time.Duration, *bool, *string, int, int, [][]int, error)
- func GetJobInfoString(ctx context.Context, ps *puzzlesstore.DBStore, genId int) (string, error)
- func GetNextClosestRatingPuzzleId(ctx context.Context, ps PuzzleStore, userId string, lexicon string) (string, pb.PuzzleQueryResult, error)
- func GetNextPuzzleId(ctx context.Context, ps PuzzleStore, userId string, lexicon string) (string, pb.PuzzleQueryResult, error)
- func GetPreviousPuzzleId(ctx context.Context, ps PuzzleStore, userId string, puzzleUUID string) (string, error)
- func GetPuzzle(ctx context.Context, ps PuzzleStore, userId string, puzzleUUID string) (*macondopb.GameHistory, string, int32, *bool, time.Time, time.Time, ...)
- func GetPuzzleAnswer(ctx context.Context, ps PuzzleStore, userId string, puzzleUUID string) (*macondopb.GameEvent, error)
- func GetPuzzleJobLogs(ctx context.Context, ps PuzzleStore, limit, offset int) ([]*pb.PuzzleJobLog, error)
- func GetStartPuzzleId(ctx context.Context, ps PuzzleStore, userId string, lexicon string) (string, pb.PuzzleQueryResult, error)
- func SetPuzzleVote(ctx context.Context, ps PuzzleStore, userId string, puzzleUUID string, ...) error
- func SubmitAnswer(ctx context.Context, ps PuzzleStore, userId string, puzzleUUID string, ...) (bool, *bool, *macondopb.GameEvent, string, int32, string, int32, time.Time, ...)
- type PuzzleService
- func (ps *PuzzleService) GetNextClosestRatingPuzzleId(ctx context.Context, req *connect.Request[pb.NextClosestRatingPuzzleIdRequest]) (*connect.Response[pb.NextClosestRatingPuzzleIdResponse], error)
- func (ps *PuzzleService) GetNextPuzzleId(ctx context.Context, req *connect.Request[pb.NextPuzzleIdRequest]) (*connect.Response[pb.NextPuzzleIdResponse], error)
- func (ps *PuzzleService) GetPreviousPuzzleId(ctx context.Context, req *connect.Request[pb.PreviousPuzzleRequest]) (*connect.Response[pb.PreviousPuzzleResponse], error)
- func (ps *PuzzleService) GetPuzzle(ctx context.Context, req *connect.Request[pb.PuzzleRequest]) (*connect.Response[pb.PuzzleResponse], error)
- func (ps *PuzzleService) GetPuzzleAnswer(ctx context.Context, req *connect.Request[pb.PuzzleRequest]) (*connect.Response[pb.AnswerResponse], error)
- func (ps *PuzzleService) GetPuzzleJobLogs(ctx context.Context, req *connect.Request[pb.PuzzleJobLogsRequest]) (*connect.Response[pb.PuzzleJobLogsResponse], error)
- func (ps *PuzzleService) GetStartPuzzleId(ctx context.Context, req *connect.Request[pb.StartPuzzleIdRequest]) (*connect.Response[pb.StartPuzzleIdResponse], error)
- func (ps *PuzzleService) SetPuzzleVote(ctx context.Context, req *connect.Request[pb.PuzzleVoteRequest]) (*connect.Response[pb.PuzzleVoteResponse], error)
- func (ps *PuzzleService) StartPuzzleGenJob(ctx context.Context, req *connect.Request[pb.APIPuzzleGenerationJobRequest]) (*connect.Response[pb.APIPuzzleGenerationJobResponse], error)
- func (ps *PuzzleService) SubmitAnswer(ctx context.Context, req *connect.Request[pb.SubmissionRequest]) (*connect.Response[pb.SubmissionResponse], error)
- type PuzzleStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePuzzlesFromGame ¶
func GetAnswer ¶
func GetAnswer(ctx context.Context, ps PuzzleStore, puzzleUUID string) (*macondopb.GameEvent, string, int32, string, *ipc.GameRequest, *entity.SingleRating, error)
func GetJobInfo ¶
func GetJobInfoString ¶
func GetNextClosestRatingPuzzleId ¶
func GetNextClosestRatingPuzzleId(ctx context.Context, ps PuzzleStore, userId string, lexicon string) (string, pb.PuzzleQueryResult, error)
func GetNextPuzzleId ¶
func GetNextPuzzleId(ctx context.Context, ps PuzzleStore, userId string, lexicon string) (string, pb.PuzzleQueryResult, error)
func GetPreviousPuzzleId ¶
func GetPuzzle ¶
func GetPuzzle(ctx context.Context, ps PuzzleStore, userId string, puzzleUUID string) (*macondopb.GameHistory, string, int32, *bool, time.Time, time.Time, *entity.SingleRating, *entity.SingleRating, error)
func GetPuzzleAnswer ¶
func GetPuzzleJobLogs ¶
func GetPuzzleJobLogs(ctx context.Context, ps PuzzleStore, limit, offset int) ([]*pb.PuzzleJobLog, error)
func GetStartPuzzleId ¶
func GetStartPuzzleId(ctx context.Context, ps PuzzleStore, userId string, lexicon string) (string, pb.PuzzleQueryResult, error)
func SetPuzzleVote ¶
func SubmitAnswer ¶
Types ¶
type PuzzleService ¶
type PuzzleService struct {
// contains filtered or unexported fields
}
func NewPuzzleService ¶
func NewPuzzleService(ps PuzzleStore, us user.Store, k, c, td string) *PuzzleService
func (*PuzzleService) GetNextClosestRatingPuzzleId ¶
func (ps *PuzzleService) GetNextClosestRatingPuzzleId(ctx context.Context, req *connect.Request[pb.NextClosestRatingPuzzleIdRequest]) (*connect.Response[pb.NextClosestRatingPuzzleIdResponse], error)
func (*PuzzleService) GetNextPuzzleId ¶
func (ps *PuzzleService) GetNextPuzzleId(ctx context.Context, req *connect.Request[pb.NextPuzzleIdRequest]) (*connect.Response[pb.NextPuzzleIdResponse], error)
func (*PuzzleService) GetPreviousPuzzleId ¶
func (ps *PuzzleService) GetPreviousPuzzleId(ctx context.Context, req *connect.Request[pb.PreviousPuzzleRequest]) (*connect.Response[pb.PreviousPuzzleResponse], error)
func (*PuzzleService) GetPuzzle ¶
func (ps *PuzzleService) GetPuzzle(ctx context.Context, req *connect.Request[pb.PuzzleRequest]) (*connect.Response[pb.PuzzleResponse], error)
func (*PuzzleService) GetPuzzleAnswer ¶
func (ps *PuzzleService) GetPuzzleAnswer(ctx context.Context, req *connect.Request[pb.PuzzleRequest]) (*connect.Response[pb.AnswerResponse], error)
func (*PuzzleService) GetPuzzleJobLogs ¶
func (ps *PuzzleService) GetPuzzleJobLogs(ctx context.Context, req *connect.Request[pb.PuzzleJobLogsRequest]) (*connect.Response[pb.PuzzleJobLogsResponse], error)
func (*PuzzleService) GetStartPuzzleId ¶
func (ps *PuzzleService) GetStartPuzzleId(ctx context.Context, req *connect.Request[pb.StartPuzzleIdRequest]) (*connect.Response[pb.StartPuzzleIdResponse], error)
func (*PuzzleService) SetPuzzleVote ¶
func (ps *PuzzleService) SetPuzzleVote(ctx context.Context, req *connect.Request[pb.PuzzleVoteRequest]) (*connect.Response[pb.PuzzleVoteResponse], error)
func (*PuzzleService) StartPuzzleGenJob ¶
func (ps *PuzzleService) StartPuzzleGenJob(ctx context.Context, req *connect.Request[pb.APIPuzzleGenerationJobRequest]) (*connect.Response[pb.APIPuzzleGenerationJobResponse], error)
func (*PuzzleService) SubmitAnswer ¶
func (ps *PuzzleService) SubmitAnswer(ctx context.Context, req *connect.Request[pb.SubmissionRequest]) (*connect.Response[pb.SubmissionResponse], error)
type PuzzleStore ¶
type PuzzleStore interface { CreateGenerationLog(ctx context.Context, req *pb.PuzzleGenerationJobRequest) (int, error) UpdateGenerationLogStatus(ctx context.Context, genId int, fulfilled bool, err error) error CreatePuzzle(ctx context.Context, gameID string, turnNumber int32, answer *macondopb.GameEvent, authorID string, lexicon string, beforeText string, afterText string, tags []macondopb.PuzzleTag, reqId int, bucketIndex int32) error GetStartPuzzleId(ctx context.Context, userId string, lexicon string, ratingKey entity.VariantKey) (string, pb.PuzzleQueryResult, error) GetNextPuzzleId(ctx context.Context, userId string, lexicon string) (string, pb.PuzzleQueryResult, error) GetNextClosestRatingPuzzleId(ctx context.Context, userId string, lexicon string, ratingKey entity.VariantKey) (string, pb.PuzzleQueryResult, error) GetPuzzle(ctx context.Context, userId string, puzzleUUID string) (*macondopb.GameHistory, string, int32, *bool, time.Time, time.Time, *entity.SingleRating, *entity.SingleRating, error) GetPreviousPuzzleId(ctx context.Context, userId string, puzzleUUID string) (string, error) GetAnswer(ctx context.Context, puzzleUUID string) (*macondopb.GameEvent, string, int32, string, *ipc.GameRequest, *entity.SingleRating, error) SubmitAnswer(ctx context.Context, userId string, ratingKey entity.VariantKey, newUserRating *entity.SingleRating, puzzleUUID string, newPuzzleRating *entity.SingleRating, userIsCorrect bool, userGaveUp bool) error GetAttempts(ctx context.Context, userId string, puzzleUUID string) (bool, bool, int32, *bool, time.Time, time.Time, *entity.SingleRating, *entity.SingleRating, error) GetUserRating(ctx context.Context, userId string, ratingKey entity.VariantKey) (*entity.SingleRating, error) SetPuzzleVote(ctx context.Context, userId string, puzzleUUID string, vote int) error GetJobInfo(ctx context.Context, genId int) (time.Time, time.Time, time.Duration, *bool, *string, int, int, [][]int, error) GetPotentialPuzzleGames(ctx context.Context, time1, time2 time.Time, limit int, lexicon string, avoidBots bool) ([]pgtype.Text, error) GetJobLogs(ctx context.Context, limit, offset int) ([]*pb.PuzzleJobLog, error) }
Click to show internal directories.
Click to hide internal directories.