domain

package
v0.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Guess

type Guess struct {
	ID           string    `json:"id"`
	UserID       int       `json:"user_id"`
	PlayerID     int       `json:"player_id"`
	Guess        int       `json:"guess"`
	ActualRank   int       `json:"actual_rank"`
	Elo          int       `json:"elo"`
	ScoreID      int       `json:"score_id"`
	Kind         RoomKind  `json:"kind"`
	BeatmapID    int       `json:"beatmap_id"`
	BeatmapSetID int       `json:"beatmapset_id"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
}

type GuessCreate

type GuessCreate struct {
	PlayerID     int      `json:"player_id"`
	Guess        int      `json:"guess"`
	ActualRank   int      `json:"actual_rank"`
	ScoreID      int      `json:"score_id"`
	BeatmapID    int      `json:"beatmap_id"`
	BeatmapSetID int      `json:"beatmapset_id"`
	Kind         RoomKind `json:"kind"`
}

type GuessExtended

type GuessExtended struct {
	Guess
	User User `json:"user"`
}

type Paged added in v0.11.0

type Paged[T any] struct {
	Items      []T `json:"items"`
	PagesTotal int `json:"pages_total"`
}

type Player

type Player struct {
	PlayerCreate
	CreatedAt time.Time `json:"created_at"`
	CheckedAt time.Time `json:"checked_at"`
}

type PlayerCreate

type PlayerCreate struct {
	OsuId  int    `json:"osu_id"`
	Source string `json:"source"`
}

type RefillResult

type RefillResult struct {
	AvailableGuesses uint      `json:"available_guesses"`
	RefilledAt       time.Time `json:"refilled_at"`
}

type Room

type Room struct {
	ID        string    `json:"id"`
	UserID    int       `json:"user_id"`
	ScoreID   int       `json:"score_id"`
	PlayerID  int       `json:"player_id"`
	Kind      RoomKind  `json:"kind"`
	ReplayURL string    `json:"replay_url"`
	GuessID   *string   `json:"guess_id" db:"guess_id"`
	ClosesAt  time.Time `json:"closes_at"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type RoomExtended

type RoomExtended struct {
	Room
	Score osuapi.Score `json:"score"`
}

type RoomKind

type RoomKind string
const (
	RoomKindRankedV1     RoomKind = "v1"
	RoomKindRankedV2     RoomKind = "v2"
	RoomKindSubmissionV2 RoomKind = "v2sub"
)

type Session

type Session struct {
	UserID int `json:"user_id"`
	SessionBase
}

type SessionBase

type SessionBase struct {
	ID           string    `json:"id"`
	AccessToken  string    `json:"access_token"`
	RefreshToken string    `json:"refresh_token"`
	ExpiresAt    time.Time `json:"expires_at"`
	CreatedAt    time.Time `json:"created_at"`
}

type SessionExtended

type SessionExtended struct {
	User User `json:"user"`
	SessionBase
}

type Stats

type Stats struct {
	Count24h    int                 `json:"count_24h"`
	CountGlobal int                 `json:"count_global"`
	Best        []GuessExtended     `json:"best"`
	TopUsers    Paged[UserExtended] `json:"top_users"`
}

type Submission

type Submission struct {
	SubmissionCreate
	ID         string    `json:"id"`
	IsAccepted bool      `json:"is_accepted"`
	CreatedAt  time.Time `json:"created_at"`
	UpdatedAt  time.Time `json:"updated_at"`
}

type SubmissionCreate

type SubmissionCreate struct {
	UserID       int    `json:"user_id"`
	PlayerID     int    `json:"player_id"`
	ScoreID      int    `json:"score_id"`
	HasReplay    bool   `json:"has_replay"`
	IsAnonymous  bool   `json:"is_anonymous"`
	BeatmapID    int    `json:"beatmap_id"`
	BeatmapsetID int    `json:"beatmapset_id"`
	Comment      string `json:"comment"`
}

type SubmissionExtended

type SubmissionExtended struct {
	Submission
	User User `json:"user"`
}

type User

type User struct {
	Elo              uint      `json:"elo"`
	OsuID            int       `json:"osu_id"`
	Username         string    `json:"username"`
	AvatarURL        string    `json:"avatar_url"`
	CountryCode      string    `json:"country_code"`
	IsAdmin          bool      `json:"is_admin"`
	AvailableGuesses uint      `json:"available_guesses"`
	RefilledAt       time.Time `json:"refilled_at"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
}

type UserExtended

type UserExtended struct {
	User
	TotalGuesses uint `json:"total_guesses"`
	Rank         uint `json:"rank"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL