gosu

package
v0.0.0-...-69245c0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RevalidateOAuthToken

func RevalidateOAuthToken(clientSecret string, clientID string) (*oauthTokenResponse, error)

Types

type Achievement

type Achievement struct {
}

type Availability

type Availability struct {
	DownloadDisabled bool   `json:"download_disabled"`
	MoreInformation  string `json:"more_information"`
}

type Beatmap

type Beatmap struct {
	BeatmapCompact
	Accuracy      float64    `json:"accuracy"`
	AR            float64    `json:"ar"`
	BeatmapSetID  int        `json:"beatmapset_id"`
	BPM           float64    `json:"bpm"`
	Convert       bool       `json:"convert"`
	CountCircles  int        `json:"count_circles"`
	CountSliders  int        `json:"count_sliders"`
	CountSpinners int        `json:"count_spinners"`
	CS            float64    `json:"cs"`
	DeletedAt     time.Time  `json:"deleted_at"`
	Drain         float64    `json:"drain"`
	HitLength     int        `json:"hit_length"`
	IsScoreable   bool       `json:"is_scoreable"`
	LastUpdated   time.Time  `json:"last_updated"`
	ModeInt       int        `json:"mode_int"`
	PassCount     int        `json:"passcount"`
	PlayCount     int        `json:"playcount"`
	Ranked        RankStatus `json:"ranked"`
	URL           string     `json:"url"`
}

type BeatmapCompact

type BeatmapCompact struct {
	DifficultyRating float64 `json:"difficulty_rating"`
	ID               int     `json:"id"`
	Mode             string  `json:"mode"` // TODO: make this compatible with enum (pain in the butt)
	Status           string  `json:"status"`
	TotalLength      int     `json:"total_length"`
	Version          string  `json:"version"`

	// Optional attributes
	Beatmapset BeatmapsetCompact `json:"beatmapset"`
	Checksum   string            `json:"checksum"`
	Failtimes  Failtimes         `json:"failtimes"`
	MaxCombo   int               `json:"max_combo"`
}

type BeatmapScores

type BeatmapScores struct {
	Scores    []Score
	UserScore BeatmapUserScore
}

type BeatmapUserScore

type BeatmapUserScore struct {
	Position int   `json:"position"`
	Score    Score `json:"score"`
}

type Beatmapset

type Beatmapset struct {
	BeatmapsetCompact `json:"beatmapset_compact"`
	Availability
	BPM               float64   `json:"bpm"`
	CanBeHyped        bool      `json:"can_be_hyped"`
	Creator           string    `json:"creator"`
	DiscussionEnabled bool      `json:"discussion_enabled"`
	DiscussionLocked  bool      `json:"discussion_locked"`
	Hype              Hype      `json:"hype"`
	IsScoreable       bool      `json:"is_scoreable"`
	LastUpdated       time.Time `json:"last_updated"`
	LegacyThreadURL   string    `json:"legacy_thread_url"`
	Ranked            int       `json:"ranked"`
	RankedDate        time.Time `json:"ranked_date"`
	Source            string    `json:"source"`
	Storyboard        bool      `json:"storyboard"`
	SubmittedDate     time.Time `json:"submitted_date"`
	Tags              string    `json:"tags"`
}

type BeatmapsetCompact

type BeatmapsetCompact struct {
	Artist        string `json:"artist"`
	ArtistUnicode string `json:"artist_unicode"`
	Covers        Covers `json:"covers"`
	Creator       string `json:"creators"`
	FavoriteCount int    `json:"favourite_count"`
	ID            int    `json:"id"`
	NSFW          bool   `json:"nsfw"`
	PlayCount     int    `json:"play_count"`
	PreviewURL    string `json:"preview_url"`
	Source        string `json:"source"`
	Status        string `json:"status"`
	Title         string `json:"title"`
	TitleUnicode  string `json:"title_unicode"`
	UserID        int    `json:"user_id"`
	Video         bool   `json:"video"`

	// Optional attributes
	// FIXME: Actual Types for most of these fields are unspecified
	Beatmaps              []Beatmap   `json:"beatmaps"`
	Converts              string      `json:"converts"`
	CurrentUserAttributes string      `json:"current_user_attributes"`
	Description           string      `json:"description"`
	Discussions           string      `json:"discussions"`
	Events                string      `json:"events"`
	Genre                 string      `json:"genre"`
	HasFavorited          bool        `json:"has_favourited"` // always included
	Language              string      `json:"language"`
	Nominations           Nominations `json:"nominations_summary"`
	Ratings               [100]int    `json:"ratings"`
	RecentFavorites       string      `json:"recent_favourites"`
	RelatedUsers          string      `json:"related_users"`
	User                  string      `json:"user"`
}

type BeatmapsetDiscussion

type BeatmapsetDiscussion struct {
	Beatmap               BeatmapCompact
	BeatmapID             int
	Beatmapset            BeatmapsetCompact
	BeatmapsetID          int
	CanBeResolved         bool
	CanGrantKudosu        bool
	CreatedAt             string
	CurrentUserAttributes CurrentUserAttributes
	DeletedAt             time.Time
	DeletedByID           int
	ID                    int
	KudosuDenied          bool
	LastPostAt            time.Time
	MessageType           string // FIXME: originally a "MessageType" object, not in docs
	ParentID              int
	Posts                 []BeatmapsetDiscussionPost
	Resolved              bool
	StartingPost          BeatmapsetDiscussionPost
	Timestamp             time.Time
	UpdatedAt             time.Time
	UserID                int
	Votes                 []BeatmapsetDiscussionVote // FIXME: structure will change
}

type BeatmapsetDiscussionPost

type BeatmapsetDiscussionPost struct {
	BeatmapsetDiscussionID int
	CreatedAt              time.Time
	DeletedAt              time.Time
	DeletedByID            int
	ID                     int
	LastEditorID           int
	Message                string
	System                 bool
	UpdatedAt              time.Time
	UserID                 int
}

type BeatmapsetDiscussionVote

type BeatmapsetDiscussionVote struct {
	BeatmapsetDiscussionID int
	CreatedAt              time.Time
	ID                     int
	Score                  int
	UpdatedAt              time.Time
	UserID                 int
}

type Channel

type Channel string

See https://osu.ppy.sh/docs/index.html?javascript#chatchannel

const (
	PUBLIC      Channel = "PUBLIC"
	PRIVATE     Channel = "PRIVATE"
	MULTIPLAYER Channel = "MULTIPLAYER"
	SPECTATOR   Channel = "SPECTATOR"
	PM          Channel = "PM"
	GROUP       Channel = "GROUP"
)

type ChatChannel

type ChatChannel struct {
	ChannelID      int
	Name           string
	Description    string
	Icon           string        // display icon for the channel
	ChannelType    Channel       // see channel types below
	FirstMessageID int           // messageID of first message (only returned in presence responses)
	LastReadID     int           // messageID of last message read (only returned in presence responses)
	LastMessageID  int           // messageID of last known message (only returned in presence responses)
	RecentMessages []ChatMessage // up to 50 most recent messages
	Moderated      bool          // user can't send message when the value is true (only returned in presence responses)
	Users          []int         // array of userID that are in the channel (not included for PUBLIC channels)
}

type ChatMessage

type ChatMessage struct {
	MessageID int         // unique Identifier for message
	SenderID  int         // userID of the sender
	ChannelID int         // channelID of where the message was sent
	Timestamp time.Time   // when the message was sent, ISO-8601
	Content   string      // message content
	IsAction  bool        // was this an action i.e. /me dances
	Sender    UserCompact // embeded UserCompact object to save additional api lookups
}

type Comment

type Comment struct {
	CommentableID   int    // ID of the object the comment is attached to
	CommentableType string // type of object the comment is attached to
	CreatedAt       string // ISO 8601 date
	DeletedAt       string // ISO 8601 date if the comment was deleted; null, otherwise
	EditedAt        string // ISO 8601 date if the comment was edited; null, otherwise
	EditedByID      int    // user ID of the user that edited the post; null, otherwise
	ID              int    // the ID of the comment
	LegacyName      string // username displayed on legacy comments
	Message         string // markdown of the comment's content
	MessageHTML     string // html version of the comment's content
	ParentID        int    // ID of the comment's parent
	Pinned          bool   // Pin status of the comment
	RepliesCount    int    // int of replies to the comment
	UpdatedAt       string // ISO 8601 date
	UserID          int    // user ID of the poster
	VotesCount      int    // int of votes
}

type CommentBundle

type CommentBundle struct {
	CommentableMeta  CommentableMeta // ID of the object the comment is attached to
	Comments         []Comment       // array of comments ordered according to sort;
	Cursor           Cursor          // no desc
	HasMore          bool            // If there are more comments or replies available
	HasMoreID        int             // no desc
	IncludedComments []Comment       // related comments; e.g. parent comments and nested replies
	PinnedComments   []Comment       // pinned comments
	Sort             string          // one of the CommentSort types
	TopLevelCount    int             // num of comments at the top level. Not returned for replies.
	Total            int             // total num of comments. Not retuned for replies.
	UserFollow       bool            // is the current user watching the comment thread
	UserVotes        []int           // IDs of the comments in the bundle the current user has upvoted
	Users            []UserCompact   // array of users related to the comments
}

type CommentableMeta

type CommentableMeta struct {
	ID         int    // the ID of the object
	Title      string // display title
	ObjectType string // the type of the object
	URL        string // URL of the object
}

type Country

type Country struct {
	Code string `json:"code"`
	Name string `json:"name"`
}

type Covers

type Covers struct {
	Cover       string `json:"cover"`
	Cover2X     string `json:"cover@2x"`
	Card        string `json:"card"`
	Card2X      string `json:"card@2x"`
	List        string `json:"list"`
	List2X      string `json:"list@2x"`
	SlimCover   string `json:"slimcover"`
	SlimCover2X string `json:"slimcover@2x"`
}

type CurrentUserAttributes

type CurrentUserAttributes struct {
	CanDestroy        bool // can delete the discussion.
	CanReopen         bool // can reopen the discussion.
	CanModerateKudosu bool // can allow or deny kudosu.
	CanResolve        bool // can resolve the discussion.
	VoteScore         int  // current vote given to the discussion.
}

type Cursor

type Cursor struct {
	Next string // request string to get next set of results
	Prev string // request string to get previous set of results
}

type Event

type Event struct {
	CreatedAt time.Time
	ID        int
	EventType EventType
}

type EventAchievement

type EventAchievement struct {
	Achievement Achievement
	User        EventUser
}

When user obtained an achievement.

type EventBeatmap

type EventBeatmap struct {
	Event
	Title string
	URL   string
}

type EventBeatmapPlaycount

type EventBeatmapPlaycount struct {
	Beatmap EventBeatmap
	Count   int
}

When a beatmap has been played for certain number of times.

type EventBeatmapset

type EventBeatmapset struct {
	Event
	Title string
	URL   string
}

type EventBeatmapsetApprove

type EventBeatmapsetApprove struct {
	Approval   RankStatus
	Beatmapset EventBeatmapset
	User       EventUser // Beatmapset owner
}

When a beatmapset changes state.

type EventBeatmapsetDelete

type EventBeatmapsetDelete struct {
	Beatmapset EventBeatmapset
}

When a beatmapset is deleted.

type EventBeatmapsetRevive

type EventBeatmapsetRevive struct {
	Beatmapset EventBeatmapset
	User       EventUser // Beatmapset owner
}

When a beatmapset in graveyard state is updated.

type EventBeatmapsetUpdate

type EventBeatmapsetUpdate struct {
	Beatmapset EventBeatmapset
	User       EventUser // Beatmapset owner
}

When a beatmapset is updated.

type EventBeatmapsetUpload

type EventBeatmapsetUpload struct {
	Beatmapset EventBeatmap
	User       EventUser // Beatmapset owner
}

When a new beatmapset is uploaded.

type EventRank

type EventRank struct {
	ScoreRank string
	Rank      int
	Mode      GameMode
	Beatmap   EventBeatmap
	User      EventUser
}

When a user achieves a certain rank on a beatmap.

type EventRankLost

type EventRankLost struct {
	Mode    GameMode
	Beatmap EventBeatmap
	User    EventUser
}

When a user loses first place to another user.

type EventType

type EventType int
const (
	TypeAchievement EventType = iota
	TypeBeatmapPlaycount
	TypeBeatmapsetApprove
	TypeBeatmapsetDelete
	TypeBeatmapsetRevive
	TypeBeatmapsetUpdate
	TypeBeatmapsetUpload
	TypeRank
	TypeRankLost
	TypeUserSupportAgain
	TypeUserSupportFirst
	TypeUserSupportGift
	TypeUsernameChange
)

type EventUser

type EventUser struct {
	Event
	Username         string
	URL              string
	PreviousUsername string // only for EventUsernameChange event
}

type EventUserSupportAgain

type EventUserSupportAgain struct {
	User EventUser
}

When a user supports osu! for the second and onwards.

type EventUserSupportFirst

type EventUserSupportFirst struct {
	User EventUser
}

When a user becomes a supporter for the first time.

type EventUserSupportGift

type EventUserSupportGift struct {
	User EventUser
}

When a user is gifted a supporter tag by another user.

type EventUsernameChange

type EventUsernameChange struct {
	User EventUser // Includes previousUsername
}

When a user changes their username.

type Failtimes

type Failtimes struct {
	Fail [100]int `json:"fail"`
	Exit [100]int `json:"exit"`
}

type ForumPost

type ForumPost struct {
	CreatedAt  time.Time
	DeletedAt  time.Time
	EditedAt   time.Time
	EditedByID int
	ForumID    int
	ID         int
	TopicID    int
	UserID     int

	BodyHTML string // post content in HTML format.
	BodyRaw  string // post content in BBCode format.
}

type ForumTopic

type ForumTopic struct {
	CreatedAt   time.Time
	DeletedAt   time.Time
	FirstPostID int
	ForumID     int
	ID          int
	IsLocked    bool
	LastPostID  int
	PostCount   int
	Title       string
	TopicType   string    // normal, sticky, or announcement
	EditedAt    time.Time // normally called "updatedAt"
	UserID      int
}

type GameMod

type GameMod int
const (
	NoFail GameMod = 1 << iota
	Easy
	TouchDevice
	Hidden
	HardRock
	SuddenDeath
	DoubleTime
	Relax
	HalfTime
	Nightcore // Only set along with DoubleTime. i.e: NC only gives 576
	Flashlight
	Autoplay
	SpunOut
	Relax2  // Autopilot
	Perfect // Only set along with SuddenDeath. i.e: PF only gives 16416
	Key4
	Key5
	Key6
	Key7
	Key8
	FadeIn
	Random
	Cinema
	Target
	Key9
	KeyCoop
	Key1
	Key3
	Key2
	ScoreV2
	Mirror
	None              = 0
	KeyMod            = Key1 | Key2 | Key3 | Key4 | Key5 | Key6 | Key7 | Key8 | Key9 | KeyCoop
	FreeModAllowed    = NoFail | Easy | Hidden | HardRock | SuddenDeath | Flashlight | FadeIn | Relax | Relax2 | SpunOut | KeyMod
	ScoreIncreaseMods = Hidden | HardRock | DoubleTime | Flashlight | FadeIn
)

type GameMode

type GameMode int
const (
	Fruits GameMode = iota
	Mania
	Osu
	Taiko
)

type Giver

type Giver struct {
	URL      string
	Username string
}

type GosuClient

type GosuClient struct {
	Token string
	// contains filtered or unexported fields
}

func CreateGosuClient

func CreateGosuClient(clientSecret string, clientID string) (*GosuClient, error)

func (*GosuClient) DoRequest

func (c *GosuClient) DoRequest(method string, url string, params map[string]interface{}) ([]byte, error)
 Send a request to the Gosu client, given:
	`method`: "GET/POST"
	`url`: the HTTP request url, e.g. "beatmaps/lookup"
	`params`: the parameters, in map[string]interface{}{...} format

func (*GosuClient) GetBeatmap

func (c *GosuClient) GetBeatmap(beatmapID string) (*Beatmap, error)

Returns a *Beatmap, given:

`beatmapID`: the ID of the beatmap

func (*GosuClient) GetBeatmapScores

func (c *GosuClient) GetBeatmapScores(beatmapID string, params map[string]interface{}) (*BeatmapScores, error)

Returns a *BeatmapScores, given:

`beatmapID`: the ID of the beatmap
`params`:
	`mode`: the gamemode to get scores for (string)
	`mods`: An array of matching mods
	`type`: Beatmap score ranking type

func (*GosuClient) GetUserBeatmapScore

func (c *GosuClient) GetUserBeatmapScore(beatmapID string, userID string, params map[string]interface{}) (*BeatmapUserScore, error)

Returns a *BeatmapUserScore, given:

`beatmapID`: the ID of the beatmap
`userID`: the user you want to get the score of
`params`:
	`mode`: the gamemode to get scores for (string)
	`mods`: An array of matching mods

func (*GosuClient) LookupBeatmap

func (c *GosuClient) LookupBeatmap(data string, queryType string) (*Beatmap, error)

Returns a *Beatmap, given data and query type (checksum, filename, or id)

type GradeCounts

type GradeCounts struct {
	A   int `json:"a"`   // Number of A ranked scores.
	S   int `json:"s"`   // Number of S ranked scores.
	SH  int `json:"sh"`  // Number of Silver S ranked scores.
	SS  int `json:"ss"`  // Number of SS ranked scores.
	SSH int `json:"ssh"` // Number of Silver SS ranked scores.
}

type Group

type Group struct {
	ID             int    `json:"id"`
	Identifier     string `json:"identifier"`      // Unique string to identify the group.
	IsProbationary string `json:"is_probationary"` // Whether members of this group are considered probationary.
	HasPlaymodes   bool   `json:"has_playmodes"`   // If this group associates GameModes with a user's membership, e.g. BN/NAT members
	Name           string `json:"name"`
	ShortName      string `json:"short_name"` // Short Name of the group for display.
	Description    string `json:"description"`
	Color          string `json:"colour"`
}

type Hype

type Hype struct {
	Current  int `json:"current"`
	Required int `json:"required"`
}

type Kudosu

type Kudosu struct {
	Available int `json:"available"`
	Total     int `json:"total"`
}

type KudosuHistory

type KudosuHistory struct {
	ID        int
	Action    string // Either give, reset, or revoke
	Amount    int
	Model     string // Object type which the exchange happened on (forum_post, etc)
	CreatedAt time.Time
	Giver     Giver // Simple detail of the user who started the exchange.
	Post      Post  // Simple detail of the object for display.
}

type MultiplayerScore

type MultiplayerScore struct {
	ID             int
	UserID         int
	RoomID         int
	PlaylistItemID int
	BeatmapID      int
	Rank           RankStatus
	TotalScore     int
	Accuracy       int
	MaxCombo       int
	Mods           []GameMod
	Statistics     UserStatistics
	Passed         bool
	Position       int
	ScoresAround   MultiplayerScoresAround // Scores around the specified score.
	User           User
}

type MultiplayerScores

type MultiplayerScores struct {
	Cursor     MultiplayerScoresCursor
	Params     []string // not specified
	Scores     []MultiplayerScore
	Total      int
	UserScores MultiplayerScore
}

type MultiplayerScoresAround

type MultiplayerScoresAround struct {
	Higher *MultiplayerScores
	Lower  *MultiplayerScores
}

type MultiplayerScoresCursor

type MultiplayerScoresCursor struct {
	ScoreID    int // Last score ID of current result (score_asc, score_desc)
	TotalScore int // Last score's total score of current result (score_asc, score_desc)
}

type MultiplayerScoresSort

type MultiplayerScoresSort struct {
	ScoreAsc  string // TODO: Figure out what the fuck this means
	ScoreDesc string
}

type Nominations

type Nominations struct {
	Current  int `json:"current"`
	Required int `json:"required"`
}

type Notification

type Notification struct {
	ID           int
	Name         string //Name of the event
	CreatedAt    string //ISO 8601 date
	ObjectType   string
	ObjectID     int
	SourceUserID int
	IsRead       bool
	Details      string // message_id of last known message (only returned in presence responses)
}

type Post

type Post struct {
	URL   string // Url of the object
	Title string // Title of the object. It'll be "[deleted beatmap]" for deleted beatmaps.
}

type ProfileBanner

type ProfileBanner struct {
	ID           int    `json:"id"`
	TournamentID int    `json:"tournament_id"`
	Image        string `json:"image"`
}

type ProfilePage

type ProfilePage struct {
	Me             string `json:"me"`
	RecentActivity string `json:"recent_activity"`
	Beatmaps       string `json:"beatmaps"`
	Historical     string `json:"historical"`
	Kudosu         Kudosu `json:"kudosu"`
	TopRanks       string `json:"top_ranks"`
	Medals         string `json:"medals"`
}

FIXME: unspecified types

type RankStatus

type RankStatus int
const (
	Graveyard RankStatus = iota - 2
	WIP
	Pending
	Ranked
	Approved
	Qualified
	Loved
)

type RankingType

type RankingType int
const (
	RankingSpotlight RankingType = iota
	RankingCountry
	RankingPerformance
	RankingScore
)

type Rankings

type Rankings struct {
	Beatmapsets []Beatmapset     // The lis of beatmaps in the requested spotlight fo the given mode; only available if type is chart
	Cursor      Cursor           // A curso
	Ranking     []UserStatistics // Score details ordered by rank in desending order
	Spotlight   Spotlight        // Spotlight details; only available iftype is chart
	Total       int              // An approximate count of ranks availl
}

type Score

type Score struct {
	ID         int        `json:"id"`
	BestID     int        `json:"best_id"`
	UserID     int        `json:"user_id"`
	Accuracy   float64    `json:"accuracy"`
	Mods       []string   `json:"mods"` // TODO: add enum support
	Score      int        `json:"score"`
	MaxCombo   int        `json:"max_combo"`
	Perfect    bool       `json:"perfect"`
	Statistics ScoreCount `json:"statistics"`
	PP         float64    `json:"pp"`
	Rank       string     `json:"rank"` // TODO: add enum support
	CreatedAt  time.Time  `json:"created_at"`
	Mode       string     `json:"mode"`
	ModeInt    int        `json:"mode_int"`
	Replay     bool       `json:"replay"`

	// Optional attributes
	Beatmap     Beatmap    `json:"beatmap"`
	Beatmapset  Beatmapset `json:"beatmapset"`
	RankCountry int        `json:"rank_country"`
	RankGlobal  int        `json:"rank_global"`
	Weight      float64    `json:"weight"`
	User        User       `json:"user"`
	Match       string     `json:"match"`
}

FIXME: Score struct has no type specifications

type ScoreCount

type ScoreCount struct {
	Count50   int `json:"count_50"`
	Count100  int `json:"count_100"`
	Count300  int `json:"count_300"`
	CountGeki int `json:"count_geki"`
	CountKatu int `json:"count_katu"`
	CountMiss int `json:"count_miss"`
}

type Spotlight

type Spotlight struct {
	EndDate          time.Time // The end date of the pot
	ID               int       // The ID of this spotl
	ModeSpecific     int       // If the spotlight has diferent mades specific to each Gam.
	ParticipantCount int       // The number of users partcipaing in this spotlight. This is only shown when viewing a single spotligt.
	Name             int       //The Name of the spotliht
	StartDate        time.Time // The starting date of he sph
	SpotlightType    string    // The type of spotligh
}

type Spotlights

type Spotlights struct {
	Spotlights []Spotlight
}

TODO: This may be uncessary

type User

type User struct {
	UserCompact
	CoverURL     string        `json:"cover_url"`     // URL of profile cover
	Discord      string        `json:"discord"`       //
	HasSupported bool          `json:"has_supported"` // whether or not ever being a supporter in the past
	Interests    string        `json:"interests"`     //
	JoinDate     time.Time     `json:"join_date"`     //
	Kudosu       Kudosu        `json:"Kudosu"`        //
	Location     string        `json:"location"`      //
	MaxBlocks    int           `json:"max_blocks"`    // maximum int of users allowed to be blocked
	MaxFriends   int           `json:"max_friends"`   // maximum int of friends allowed to be added
	Occupation   string        `json:"occupation"`    //
	Playmode     GameMode      `json:"playmode"`      //
	Playstyle    string        `json:"playstyle"`     // Device choices of the user.
	PostCount    int           `json:"post_count"`    // int of forum posts
	ProfileOrder []ProfilePage `json:"profile_order"` // ordered array of sections in user profile page
	Title        string        `json:"title"`         // user-specific title
	TitleURL     string        `json:"title_url"`     //
	Twitter      string        `json:"twitter"`       //
	Website      string        `json:"website"`       //
}

type UserAccountHistory

type UserAccountHistory struct {
	ID        int       `json:"id"`        //
	UserType  string    `json:"type"`      // .note, restriction, or silence.
	Timestamp time.Time `json:"timestamp"` //
	Length    int       `json:"length"`    // In seconds.
}

type UserBadge

type UserBadge struct {
	AwardedAt   time.Time `json:"awarded_at"`
	Description string    `json:"description"`
	ImageURL    string    `json:"image_url"`
	URL         string    `json:"url"`
}

type UserCompact

type UserCompact struct {
	AvatarURL     string    `json:"avatar_url"`      // URL of user's avatar
	CountryCode   string    `json:"country_code"`    // two-letter code representing user's country
	DefaultGroup  string    `json:"default_group"`   // Identifier of the default Group the user belongs to.
	ID            int       `json:"id"`              // unique identifier for user
	IsActive      bool      `json:"is_active"`       // has this account been active in the last x months?
	IsBot         bool      `json:"is_bot"`          // is this a bot account?
	IsDeleted     bool      `json:"is_deleted"`      // is the user currently online? (either on lazer or the new website)
	IsOnline      bool      `json:"is_online"`       //
	IsSupporter   bool      `json:"is_supported"`    // does this user have supporter?
	LastVisit     time.Time `json:"last_visit"`      // last access time. null if the user hides online presence
	PMFriendsOnly bool      `json:"pm_friends_only"` // whether or not the user allows PM from other than friends
	ProfileColor  string    `json:"profile_colour"`  // color of username/profile highlight, hex code (e.g. #333333)
	Username      string    `json:"username"`        // user's display Name

	// Optional attributes
	AccountHistory                   []UserAccountHistory   `json:"account_history"`
	ActiveTournamentBanner           ProfileBanner          `json:"active_tournament_banner"`
	Badges                           []UserBadge            `json:"badges"`
	BeatmapsPlaycountCount           int                    `json:"beatmap_playcounts_count"`
	Blocks                           string                 `json:"blocks"`  // FIXME: Unspecified in docs
	Country                          Country                `json:"country"` // FIXME: Unspecified in docs
	Cover                            UserCover              `json:"cover"`   // FIXME: Unspecified in docs
	FavoriteBeatmapsetCount          int                    `json:"favourite_beatmapset_count"`
	FollowerCount                    int                    `json:"follower_count"`
	Friends                          []string               `json:"friends"` // FIXME: Unspecified in docs
	GraveyardBeatmapsetCount         int                    `json:"graveyard_beatmapset_count"`
	Groups                           []UserGroup            `json:"groups"`
	IsAdmin                          bool                   `json:"is_admin"`
	IsBNG                            bool                   `json:"is_bng"`
	IsFullBN                         bool                   `json:"is_full_bn"`
	IsGMT                            bool                   `json:"is_gmt"`
	IsLimitedBN                      bool                   `json:"is_limited_bn"`
	IsModerator                      bool                   `json:"is_moderator"`
	IsNAT                            bool                   `json:"is_nat"`
	IsRestricted                     bool                   `json:"is_restricted"`
	IsSilenced                       bool                   `json:"is_silenced"`
	LovedBeatmapsetCount             int                    `json:"loved_beatmapset_count"`
	MonthlyPlaycounts                []UserMonthlyPlaycount `json:"monthly_playcounts"`
	Page                             string                 `json:"page "`              // FIXME: Unspecified in docs
	PreviousUsernames                []string               `json:"previous_usernames"` // FIXME: Unspecified in docs
	RankedAndApprovedBeatmapsetCount int                    `json:"ranked_and_approved_beatmapset_count"`
	ReplaysWatchedCount              int                    `json:"replays_watched_counts"`
	ScoresBestCount                  int                    `json:"scores_best_count"`
	ScoresFirstCount                 int                    `json:"scores_first_count"`
	ScoresRecentCount                int                    `json:"scores_recent_count"`
	Statistics                       *UserStatistics        `json:"statistics"` // FIXME: Unspecified in docs
	StatisticsRulesets               UserStatisticsRulesets `json:"statistics_rulesets"`
	SupportLevel                     int                    `json:"support_level"`             // FIXME: Unspecified in docs
	UnrankedBeatmapsetCount          int                    `json:"unranked_beatmapset_count"` // FIXME: Unspecified in docs
	UnreadPMCount                    int                    `json:"unread_pm_count"`           // FIXME: Unspecified in docs
	UserAchievements                 int                    `json:"user_achievements"`         // FIXME: Unspecified in docs
	UserPreferences                  string                 `json:"user_preferences"`          // FIXME: Unspecified in docs
	RankHistory                      string                 `json:"rank_history"`              // FIXME: Unspecified in docs
}

type UserCover

type UserCover struct {
	CustomURL string `json:"custom_url"`
	URL       string `json:"url"`
	ID        string `json:"id"`
}

type UserGroup

type UserGroup struct {
	ID             int      `json:"id"`              // ID (of Group)
	Identifier     string   `json:"identifier"`      // Unique string to identify the group.
	IsProbationary bool     `json:"is_probationary"` // Whether members of this group are considered probationary.
	Name           string   `json:"name"`            //
	ShortName      string   `json:"short_name"`      // Short Name of the group for display.
	Description    string   `json:"description"`     //
	Color          string   `json:"colour"`          //
	Playmodes      []string `json:"playmodes"`       // GameModes which the member is responsible for, e.g. in the case of BN/NAT (only present when hasPlaymodes is set on Group)
}

type UserLevel

type UserLevel struct {
	Current  int `json:"current"`
	Progress int `json:"progress"`
}

type UserMonthlyPlaycount

type UserMonthlyPlaycount struct {
}

type UserStatistics

type UserStatistics struct {
	GradeCounts            GradeCounts
	HitAccuracy            int          `json:"hit_accuracy"`              // Hit accuracy percentage
	IsRanked               bool         `json:"is_ranked"`                 // Is actively ranked
	Level                  UserLevel    `json:"level"`                     //
	MaxCombo               int          `json:"maximum_combo"`             // Highest maximum combo.
	PlayCount              int          `json:"play_count"`                // Number of maps played.
	PlayTime               int          `json:"play_time"`                 // Cumulative time played.
	PP                     int          `json:"pp"`                        // Performance points
	GlobalRank             int          `json:"global_rank"`               // Current rank according to pp.
	RankedScore            int          `json:"ranked_score"`              // Current ranked score.
	ReplaysWatchedByOthers int          `json:"replays_watched_by_others"` // Number of replays watched by other users.
	TotalHits              int          `json:"total_hits"`                // Total int of hits.
	TotalScore             int          `json:"total_score"`               // Total score.
	User                   *UserCompact `json:"user"`                      // The associated user.
}

type UserStatisticsRulesets

type UserStatisticsRulesets struct {
}

type WikiPage

type WikiPage struct {
	Layout   string   // The layout type for the page.
	Locale   string   // All lowercase BCP 47 language tag.
	Markdown string   // Markdown content.
	Path     string   // Path of the article.
	Subtitle string   // 	The article's subtitle.
	Tags     []string // Associated tags for the article.
	Title    string   // The article's title.
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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