gosu

package module
v0.0.0-...-5023bff Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 11 Imported by: 0

README

gosu

Go Reference

gosu is a wrapper for the osu!api v2.

Coverage

WIP. Goal is to have 100% coverage of the documented osu!api v2.

Endpoints
  • Authentication (currently only supports client credentials)
  • Beatmap Packs
  • Beatmaps
  • Beatmapset Discussions
  • Beatmapsets
  • Changelog
  • Chat
  • Comments
  • Events
  • Forum
  • Multiplayer
  • News
  • Ranking
  • Users
  • Wiki
Other
  • Tests
  • Documentation

Documentation

Index

Constants

View Source
const (
	MessageTypeSuggestion = "suggestion"
	MessageTypeProblem    = "problem"
	MessageTypeMapperNote = "mapper_note"
	MessageTypePraise     = "praise"
	MessageTypeHype       = "hype"
	MessageTypeReview     = "review"
)
View Source
const (
	DiscussionPostTypeFirst  = "first"
	DiscussionPostTypeReply  = "reply"
	DiscussionPostTypeSystem = "system"
)
View Source
const (
	DiscussionVoteDirectionUp   = "1"
	DiscussionVoteDirectionDown = "-1"
)
View Source
const (
	SortArtist     BeatmapsetSearchSort = "artist"
	SortFavourites                      = "favourites"
	SortPlaycount                       = "plays"
	SortRankedDate                      = "ranked"
	SortRating                          = "rating"
	SortRelevance                       = "relevance"
	SortStars                           = "stars"
	SortTitle                           = "title"
)
View Source
const (
	ChangelogStreamStable40    = "stable40"
	ChangelogStreamBeta40      = "beta40"
	ChangelogStreamCuttingEdge = "cuttingedge"
	ChangelogStreamLazer       = "lazer"
	ChangelogStreamWeb         = "web"
)
View Source
const (
	MessageFormatHTML     = "html"
	MessageFormatMarkdown = "markdown"
)
View Source
const (
	MultiplayerScoresSortAscending  = "score_asc"
	MultiplayerScoresSortDescending = "score_desc"
)
View Source
const (
	RankingVariant4k = "4k"
	RankingVariant7k = "7k"
)
View Source
const (
	SortDescending = "id_desc"
	SortAscending  = "id_asc"
)

Variables

View Source
var ErrInvalidRankStatus = errors.New("not a valid RankStatus")
View Source
var ErrInvalidRuleset = errors.New("not a valid Ruleset")

Functions

func ModsToString

func ModsToString(mods Mod) string

func ModsToStrings

func ModsToStrings(mods Mod) []string

Types

type BaseDifficultyAttributes

type BaseDifficultyAttributes struct {
	Attributes struct {
		MaxCombo          int                `json:"max_combo"`
		StarRating        float32            `json:"star_rating"`
		RulesetAttributes map[string]float32 `json:"ruleset_attributes,remain"`
	} `json:"attributes"`
}

type Beatmap

type Beatmap struct {
	BeatmapCompact
	Accuracy      float32    `json:"accuracy"`
	AR            float32    `json:"ar"`
	BeatmapsetID  int        `json:"beatmapset_id"`
	BPM           *float32   `json:"bpm"`
	Convert       bool       `json:"convert"`
	CountCircles  int        `json:"count_circles"`
	CountSliders  int        `json:"count_sliders"`
	CountSpinners int        `json:"count_spinners"`
	CS            float32    `json:"cs"`
	DeletedAt     *time.Time `json:"deleted_at"`
	Drain         float32    `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        int        `json:"ranked"`
	URL           string     `json:"url"`
}

type BeatmapAttributesRequest

type BeatmapAttributesRequest struct {
	Beatmap int
	Mods    Mod
	Mode    *Ruleset
	// contains filtered or unexported fields
}

func (*BeatmapAttributesRequest) AddMods

func (*BeatmapAttributesRequest) Build

func (*BeatmapAttributesRequest) SetMode

func (*BeatmapAttributesRequest) SetMods

type BeatmapCompact

type BeatmapCompact struct {
	BeatmapsetID     int     `json:"beatmapset_id"`
	DifficultyRating float32 `json:"difficulty_rating"`
	ID               int     `json:"id"`
	Mode             Ruleset `json:"mode"`
	Status           string  `json:"status"`
	TotalLength      int     `json:"total_length"`
	UserID           int     `json:"user_id"`
	Version          string  `json:"version"`
}

type BeatmapPlaycountEvent

type BeatmapPlaycountEvent struct {
	Beatmap EventBeatmap `json:"beatmap"`
	Count   int          `json:"count"`
}

type BeatmapRequest

type BeatmapRequest struct {
	Beatmap int
	// contains filtered or unexported fields
}

func (*BeatmapRequest) Build

func (r *BeatmapRequest) Build() (*BeatmapResponse, error)

type BeatmapResponse

type BeatmapResponse struct {
	Beatmap
	Beatmapset struct {
		Beatmapset
		Ratings []int `json:"ratings"`
	} `json:"beatmapset"`
	Checksum  *string   `json:"checksum"`
	FailTimes FailTimes `json:"failtimes"`
	MaxCombo  int       `json:"max_combo"`
}

type BeatmapScores

type BeatmapScores struct {
	Scores []struct {
		Score
		User struct {
			Country `json:"country"`
			Cover   `json:"cover"`
		} `json:"user"`
	} `json:"scores"`
}

type BeatmapScoresRequest

type BeatmapScoresRequest struct {
	Beatmap int
	Mode    *Ruleset
	// contains filtered or unexported fields
}

func (*BeatmapScoresRequest) Build

func (r *BeatmapScoresRequest) Build() (*BeatmapScores, error)

func (*BeatmapScoresRequest) SetMode

type BeatmapsRequest

type BeatmapsRequest struct {
	Beatmaps []int
	// contains filtered or unexported fields
}

func (*BeatmapsRequest) Build

func (r *BeatmapsRequest) Build() (*GetBeatmapsResponse, error)

type Beatmapset

type Beatmapset struct {
	BeatmapsetCompact
	Availability       BeatmapsetAvailability `json:"availability"`
	BPM                float32                `json:"bpm"`
	CanBeHyped         bool                   `json:"can_be_hyped"`
	DeletedAt          *time.Time             `json:"deleted_at"`
	DiscussionLocked   bool                   `json:"discussion_locked"`
	Hype               *BeatmapsetHype        `json:"hype"`
	IsScoreable        bool                   `json:"is_scoreable"`
	LastUpdated        time.Time              `json:"last_updated"`
	LegacyThreadURL    *string                `json:"legacy_thread_url"`
	NominationsSummary BeatmapsetNominations  `json:"nominations_summary"`
	Ranked             int                    `json:"ranked"`
	RankedDate         *time.Time             `json:"ranked_date"`
	Storyboard         bool                   `json:"storyboard"`
	SubmittedDate      *time.Time             `json:"submitted_date"`
	Tags               string                 `json:"tags"`
}

type BeatmapsetApproveEvent

type BeatmapsetApproveEvent struct {
	Approval   RankStatus      `json:"approval"`
	Beatmapset EventBeatmapset `json:"beatmapset"`
	User       EventUser       `json:"user"`
}

type BeatmapsetAvailability

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

type BeatmapsetCompact

type BeatmapsetCompact struct {
	Artist         string          `json:"artist"`
	ArtistUnicode  *string         `json:"artist_unicode"`
	Covers         BeatmapsetCover `json:"covers"`
	Creator        string          `json:"creator"`
	FavouriteCount int             `json:"favourite_count"`
	Hype           *BeatmapsetHype `json:"hype"`
	ID             int             `json:"id"`
	NSFW           bool            `json:"nsfw"`
	Offset         int             `json:"offset"`
	PlayCount      int             `json:"play_count"`
	PreviewURL     string          `json:"preview_url"`
	Source         string          `json:"source"`
	Status         string          `json:"status"`
	Spotlight      bool            `json:"spotlight"`
	Title          string          `json:"title"`
	TitleUnicode   string          `json:"title_unicode"`
	UserID         int             `json:"user_id"`
	Video          bool            `json:"video"`
}

type BeatmapsetCover

type BeatmapsetCover 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 BeatmapsetDeleteEvent

type BeatmapsetDeleteEvent struct {
	Beatmapset EventBeatmapset `json:"beatmapset"`
}

type BeatmapsetDiscussion

type BeatmapsetDiscussion struct {
	BeatmapID      *int        `json:"beatmap_id"`
	BeatmapsetID   *int        `json:"beatmapset_id"`
	CanBeResolved  bool        `json:"can_be_resolved"`
	CanGrantKudosu bool        `json:"can_grant_kudosu"`
	CreatedAt      time.Time   `json:"created_at"`
	DeletedAt      *time.Time  `json:"deleted_at"`
	DeletedByID    *int        `json:"deleted_by_id"`
	ID             int         `json:"id"`
	KudosuDenied   bool        `json:"kudosu_denied"`
	LastPostAt     time.Time   `json:"last_post_at"`
	MessageType    MessageType `json:"message_type"`
	ParentID       *int        `json:"parent_id"`
	Resolved       bool        `json:"resolved"`
	Timestamp      *int        `json:"timestamp"`
	UpdatedAt      time.Time   `json:"updated_at"`
	UserID         *int        `json:"user_id"`
}

type BeatmapsetGenre

type BeatmapsetGenre struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type BeatmapsetHype

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

type BeatmapsetLanguage

type BeatmapsetLanguage struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type BeatmapsetNominations

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

type BeatmapsetReviveEvent

type BeatmapsetReviveEvent struct {
	Beatmapset EventBeatmapset `json:"beatmapset"`
	User       EventUser       `json:"user"`
}

type BeatmapsetSearchResponse

type BeatmapsetSearchResponse struct {
	Cursor      *Cursor `json:"cursor"`
	Beatmapsets []struct {
		Beatmapset
		Beatmaps []struct {
			Beatmap
			Checksum string `json:"checksum"`
			MaxCombo int    `json:"max_combo"`
		} `json:"beatmaps"`
		PackTags []string `json:"pack_tags"`
	} `json:"beatmapsets"`
	Total int `json:"total"`
}

type BeatmapsetSearchSort

type BeatmapsetSearchSort string

type BeatmapsetUpdateEvent

type BeatmapsetUpdateEvent struct {
	Beatmapset EventBeatmapset `json:"beatmapset"`
	User       EventUser       `json:"user"`
}

type BeatmapsetUploadEvent

type BeatmapsetUploadEvent struct {
	Beatmapset EventBeatmapset `json:"beatmapset"`
	User       EventUser       `json:"user"`
}

type BeatmapsetWithIDRequest

type BeatmapsetWithIDRequest struct {
	BeatmapsetID int
	// contains filtered or unexported fields
}

func (*BeatmapsetWithIDRequest) Build

type BeatmapsetWithSearchRequest

type BeatmapsetWithSearchRequest struct {
	Query *string
	Mode  *Ruleset

	Genre      *Genre
	Language   *Language
	Video      bool
	Storyboard bool
	NSFW       bool
	Sort       *BeatmapsetSearchSort
	Descending bool
	Cursor     *Cursor
	// contains filtered or unexported fields
}

func (*BeatmapsetWithSearchRequest) AnyStatus

func (*BeatmapsetWithSearchRequest) Build

func (*BeatmapsetWithSearchRequest) SetCursor

func (*BeatmapsetWithSearchRequest) SetGenre

func (*BeatmapsetWithSearchRequest) SetLanguage

func (*BeatmapsetWithSearchRequest) SetMode

func (*BeatmapsetWithSearchRequest) SetNSFW

func (*BeatmapsetWithSearchRequest) SetQuery

func (*BeatmapsetWithSearchRequest) SetStatus

func (*BeatmapsetWithSearchRequest) SetStoryboard

func (r *BeatmapsetWithSearchRequest) SetStoryboard(storyboard bool) *BeatmapsetWithSearchRequest

func (*BeatmapsetWithSearchRequest) SetVideo

func (*BeatmapsetWithSearchRequest) SortBy

type Build

type Build struct {
	CreatedAt      time.Time     `json:"created_at"`
	DisplayVersion string        `json:"display_version"`
	ID             int           `json:"id"`
	UpdateStream   *UpdateStream `json:"update_stream"`
	Users          int           `json:"users"`
	Version        *string       `json:"version"`
	YoutubeID      *string       `json:"youtube_id"`
}

type BuildVersions

type BuildVersions struct {
	Next     *Build `json:"next"`
	Previous *Build `json:"previous"`
}

type ChangelogBuildRequest

type ChangelogBuildRequest struct {
	Stream       string
	BuildVersion string
	// contains filtered or unexported fields
}

func (*ChangelogBuildRequest) Build

type ChangelogBuildResponse

type ChangelogBuildResponse struct {
	Build
	ChangelogEntries []struct {
		ChangelogEntry
		GithubUser  GithubUser `json:"github_user"`
		Message     *string    `json:"message"`
		MessageHTML *string    `json:"message_html"`
	} `json:"changelog_entries"`
	Versions BuildVersions `json:"versions"`
}

type ChangelogEntry

type ChangelogEntry struct {
	Category            string     `json:"category"`
	CreatedAt           *time.Time `json:"created_at"`
	GithubPullRequestID *int       `json:"github_pull_request_id"`
	GithubURL           *string    `json:"github_url"`
	ID                  *int       `json:"id"`
	Major               bool       `json:"major"`
	Repository          *string    `json:"repository"`
	Title               *string    `json:"title"`
	Type                string     `json:"type"`
	URL                 *string    `json:"url"`
}

type ChangelogListingRequest

type ChangelogListingRequest struct {
	From           *string
	MaxID          *int
	Stream         *ChangelogStream
	To             *string
	MessageFormats []MessageFormat
	// contains filtered or unexported fields
}

func (*ChangelogListingRequest) Build

func (*ChangelogListingRequest) SetFrom

func (*ChangelogListingRequest) SetMaxID

func (*ChangelogListingRequest) SetMessageFormats

func (r *ChangelogListingRequest) SetMessageFormats(messageFormats []MessageFormat) *ChangelogListingRequest

func (*ChangelogListingRequest) SetStream

func (*ChangelogListingRequest) SetTo

type ChangelogListingResponse

type ChangelogListingResponse struct {
	Builds []struct {
		ChangelogEntries []struct {
			ChangelogEntry
			GithubUser  GithubUser `json:"github_user"`
			Message     *string    `json:"message"`
			MessageHTML *string    `json:"message_html"`
		} `json:"changelog_entries"`
		CreatedAt      time.Time    `json:"created_at"`
		DisplayVersion string       `json:"display_version"`
		ID             int          `json:"id"`
		UpdateStream   UpdateStream `json:"update_stream"`
		Users          int          `json:"users"`
		Version        string       `json:"version"`
		YoutubeID      *string      `json:"youtube_id"`
	} `json:"builds"`
	Search struct {
		From   *string `json:"from"`
		Limit  int     `json:"limit"`
		MaxID  *int    `json:"max_id"`
		Stream *string `json:"stream"`
		To     *string `json:"to"`
	} `json:"search"`
	Streams []struct {
		UpdateStream
		LatestBuild Build `json:"latest_build"`
		UserCount   int   `json:"user_count"`
	} `json:"streams"`
}

type ChangelogStream

type ChangelogStream string

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(clientID int, clientSecret string) (*Client, error)

NewClient creates a gosu client with client credentials.

func (*Client) GetBeatmap

func (c *Client) GetBeatmap(beatmap int) *BeatmapRequest

GetBeatmap returns beatmap data for the specified beatmap ID.

func (*Client) GetBeatmapAttributes

func (c *Client) GetBeatmapAttributes(beatmap int) *BeatmapAttributesRequest

GetBeatmapAttributes returns difficulty attributes of beatmap with specific mode and mods combination.

func (*Client) GetBeatmapScores

func (c *Client) GetBeatmapScores(beatmap int) *BeatmapScoresRequest

GetBeatmapScores returns the top scores for a beatmap. Depending on user preferences, this may only show legacy scores.

func (*Client) GetBeatmaps

func (c *Client) GetBeatmaps(beatmaps []int) *BeatmapsRequest

GetBeatmaps returns a list of beatmaps.

func (*Client) GetBeatmapsetWithID

func (c *Client) GetBeatmapsetWithID(beatmapsetID int) *BeatmapsetWithIDRequest

GetBeatmapsetWithID returns a beatmapset, using its ID.

func (*Client) GetBeatmapsetWithSearch

func (c *Client) GetBeatmapsetWithSearch() *BeatmapsetWithSearchRequest

GetBeatmapsetWithSearch returns a beatmapset, using a search query.

func (*Client) GetChangelogBuild

func (c *Client) GetChangelogBuild(stream string, build string) *ChangelogBuildRequest

GetChangelogBuild returns details of the specified build.

func (*Client) GetChangelogListing

func (c *Client) GetChangelogListing() *ChangelogListingRequest

GetChangelogListing returns a listing of update streams, builds, and changelog entries.

func (*Client) GetDiscussionPosts

func (c *Client) GetDiscussionPosts() *DiscussionPostsRequest

GetDiscussionPosts returns the posts of beatmapset discussions.

func (*Client) GetDiscussionVotes

func (c *Client) GetDiscussionVotes() *DiscussionVotesRequest

GetDiscussionVotes returns the votes given to beatmapset discussions.

func (*Client) GetDiscussions

func (c *Client) GetDiscussions() *DiscussionsRequest

GetDiscussions returns a list of beatmapset discussions.

func (*Client) GetKudosuRanking

func (c *Client) GetKudosuRanking() *KudosuRankingRequest

GetKudosuRanking returns the kudosu ranking.

func (*Client) GetNewsListing

func (c *Client) GetNewsListing() *NewsListingRequest

GetNewsListing returns a list of news posts and related metadata.

func (*Client) GetNewsPost

func (c *Client) GetNewsPost(news string) *NewsPostRequest

GetNewsPost returns details of the specified news post.

func (*Client) GetOwnData

func (c *Client) GetOwnData() *OwnDataRequest

GetOwnData is similar to GetUser, but with the authenticated user (token owner) as user id. Requires Authorization Code Grant authentication.

func (*Client) GetPlaylistScores

func (c *Client) GetPlaylistScores(room, playlist int) *PlaylistScoresRequest

func (*Client) GetRanking

func (c *Client) GetRanking(mode Ruleset, rankingType RankingType) *RankingRequest

GetRanking returns the current ranking for the specified type and game mode.

func (*Client) GetSpotlights

func (c *Client) GetSpotlights() *SpotlightsRequest

GetSpotlights returns the list of spotlights.

func (*Client) GetUser

func (c *Client) GetUser(user string) *UserRequest

GetUser returns the details of a user.

func (*Client) GetUserBeatmapScore

func (c *Client) GetUserBeatmapScore(beatmap int, user int) *UserBeatmapScoreRequest

GetUserBeatmapScore returns a user's score on a beatmap.

func (*Client) GetUserBeatmapScores

func (c *Client) GetUserBeatmapScores(beatmap int, user int) *UserBeatmapScoresRequest

GetUserBeatmapScores returns a user's scores on a beatmap.

func (*Client) GetUserBeatmaps

func (c *Client) GetUserBeatmaps(user int, mapType RankStatus) *UserBeatmapsRequest

GetUserBeatmaps returns the beatmaps of a user.

func (*Client) GetUserKudosu

func (c *Client) GetUserKudosu(user int) *UserKudosuRequest

GetUserKudosu returns the kudosu history of a user.

func (*Client) GetUserMostPlayed

func (c *Client) GetUserMostPlayed(user int) *UserMostPlayedRequest

GetUserMostPlayed returns a user's most played beatmaps.

func (*Client) GetUserRecentActivity

func (c *Client) GetUserRecentActivity(user int) *UserRecentActivityRequest

GetUserRecentActivity returns the recent activity of a user.

func (*Client) GetUserScores

func (c *Client) GetUserScores(user int) *UserScoresRequest

GetUserScores returns the scores of a user.

func (*Client) GetUsers

func (c *Client) GetUsers(userIds []int) *UsersRequest

GetUsers returns a list of users.

func (*Client) GetWikiPage

func (c *Client) GetWikiPage(locale string, path string) *WikiPageRequest

GetWikiPage retyrns a page from the wiki.

func (*Client) LookupBeatmap

func (c *Client) LookupBeatmap() *LookupBeatmapRequest

LookupBeatmap returns beatmap.

func (*Client) LookupChangelogBuild

func (c *Client) LookupChangelogBuild(changelog string) *LookupChangelogBuildRequest

LookupChangelogBuild returns details of the specified build.

type Country

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

type Cover

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

type Cursor

type Cursor interface{}

type DiscussionBaseRequest

type DiscussionBaseRequest struct {
	Limit *int
	Page  *int
	Sort  *Sort
	// contains filtered or unexported fields
}

type DiscussionPost

type DiscussionPost struct {
	BeatmapsetDiscussionID int         `json:"beatmapset_discussion_id"`
	CreatedAt              time.Time   `json:"created_at"`
	DeletedAt              *time.Time  `json:"deleted_at"`
	DeletedByID            *int        `json:"deleted_by_id"`
	ID                     int         `json:"id"`
	LastEditorID           *int        `json:"last_editor_id"`
	Message                interface{} `json:"message"`
	System                 bool        `json:"system"`
	UpdatedAt              time.Time   `json:"updated_at"`
	UserID                 int         `json:"user_id"`
}

type DiscussionPostType

type DiscussionPostType string

type DiscussionPostsRequest

type DiscussionPostsRequest struct {
	DiscussionBaseRequest
	BeatmapsetDiscussionID *int
	Types                  []DiscussionPostType
	User                   *int
}

func (*DiscussionPostsRequest) AddType

func (*DiscussionPostsRequest) Build

func (*DiscussionPostsRequest) SetDiscussionID

func (r *DiscussionPostsRequest) SetDiscussionID(discussionID int) *DiscussionPostsRequest

func (*DiscussionPostsRequest) SetLimit

func (*DiscussionPostsRequest) SetPage

func (*DiscussionPostsRequest) SetSort

func (*DiscussionPostsRequest) SetTypes

func (*DiscussionPostsRequest) SetUser

type DiscussionPostsResponse

type DiscussionPostsResponse struct {
	Beatmapsets  []BeatmapsetCompact    `json:"beatmapsets"`
	CursorString Cursor                 `json:"cursor_string"`
	Discussions  []BeatmapsetDiscussion `json:"discussions"`
	Posts        []DiscussionPost       `json:"posts"`
	Users        []UserCompact          `json:"users"`
}

type DiscussionStatus

type DiscussionStatus string
const (
	DiscussionStatusAll            DiscussionStatus = "all"
	DiscussionStatusRanked         DiscussionStatus = "ranked"
	DiscussionStatusQualified      DiscussionStatus = "qualified"
	DiscussionStatusDisqualified   DiscussionStatus = "disqualified"
	DiscussionStatusNeverQualified DiscussionStatus = "never_qualified"
)

type DiscussionVote

type DiscussionVote struct {
	BeatmapsetDiscussionID int       `json:"beatmapset_discussion_id"`
	CreatedAt              time.Time `json:"created_at"`
	ID                     int       `json:"id"`
	Score                  int       `json:"score"`
	UpdatedAt              time.Time `json:"updated_at"`
	UserID                 int       `json:"user_id"`
}

type DiscussionVoteDirection

type DiscussionVoteDirection string

type DiscussionVotesRequest

type DiscussionVotesRequest struct {
	DiscussionBaseRequest
	BeatmapsetDiscussionID *int
	Receiver               *int                     `json:"receiver"`
	Score                  *DiscussionVoteDirection `json:"score"`
	User                   *int                     `json:"user"`
}

func (*DiscussionVotesRequest) Build

func (*DiscussionVotesRequest) SetDiscussionID

func (r *DiscussionVotesRequest) SetDiscussionID(discussionID int) *DiscussionVotesRequest

func (*DiscussionVotesRequest) SetLimit

func (*DiscussionVotesRequest) SetPage

func (*DiscussionVotesRequest) SetReceiver

func (r *DiscussionVotesRequest) SetReceiver(receiverID int) *DiscussionVotesRequest

func (*DiscussionVotesRequest) SetScore

func (*DiscussionVotesRequest) SetSort

func (*DiscussionVotesRequest) SetUser

type DiscussionVotesResponse

type DiscussionVotesResponse struct {
	CursorString Cursor                 `json:"cursor_string"`
	Discussions  []BeatmapsetDiscussion `json:"discussions"`
	Users        []UserCompact          `json:"users"`
	Votes        []DiscussionVote       `json:"votes"`
}

type DiscussionsRequest

type DiscussionsRequest struct {
	DiscussionBaseRequest
	BeatmapID        *int `json:"beatmap_id"`
	BeatmapsetID     *int `json:"beatmapset_id"`
	BeatmapsetStatus *DiscussionStatus
	MessageTypes     []MessageType `json:"message_types"`
	OnlyUnresolved   *bool         `json:"only_unresolved"`
	User             *int          `json:"user"`
}

func (*DiscussionsRequest) AddMessageType

func (r *DiscussionsRequest) AddMessageType(types MessageType) *DiscussionsRequest

func (*DiscussionsRequest) Build

func (*DiscussionsRequest) SetBeatmapID

func (r *DiscussionsRequest) SetBeatmapID(beatmapID int) *DiscussionsRequest

func (*DiscussionsRequest) SetBeatmapsetID

func (r *DiscussionsRequest) SetBeatmapsetID(beatmapsetID int) *DiscussionsRequest

func (*DiscussionsRequest) SetBeatmapsetStatus

func (r *DiscussionsRequest) SetBeatmapsetStatus(status DiscussionStatus) *DiscussionsRequest

func (*DiscussionsRequest) SetLimit

func (r *DiscussionsRequest) SetLimit(limit int) *DiscussionsRequest

func (*DiscussionsRequest) SetMessageTypes

func (r *DiscussionsRequest) SetMessageTypes(types []MessageType) *DiscussionsRequest

func (*DiscussionsRequest) SetOnlyUnresolved

func (r *DiscussionsRequest) SetOnlyUnresolved(onlyUnresolved bool) *DiscussionsRequest

func (*DiscussionsRequest) SetPage

func (r *DiscussionsRequest) SetPage(page int) *DiscussionsRequest

func (*DiscussionsRequest) SetSort

func (r *DiscussionsRequest) SetSort(sort Sort) *DiscussionsRequest

func (*DiscussionsRequest) SetUser

func (r *DiscussionsRequest) SetUser(userID int) *DiscussionsRequest

type DiscussionsResponse

type DiscussionsResponse struct {
	CursorString        Cursor                 `json:"cursor_string"`
	Users               []UserCompact          `json:"users"`
	Discussions         []BeatmapsetDiscussion `json:"discussions"`
	IncludedDiscussions []BeatmapsetDiscussion `json:"included_discussions"`
	Beatmapsets         []Beatmapset           `json:"beatmapsets"`
	Beatmaps            []struct {
		Beatmap
		Checksum *string `json:"checksum"`
	} `json:"beatmaps"`
	ReviewsConfig struct {
		MaxBlocks int `json:"max_blocks"`
	} `json:"reviews_config"`
}

type EventBase

type EventBase struct {
	CreatedAt       time.Time `json:"created_at" json:"created_at"`
	ID              int
	Type            EventType              `json:"type"`
	EventAttributes map[string]interface{} `json:",remain"`
}

type EventBeatmap

type EventBeatmap struct {
	Title string `json:"title"`
	URL   string `json:"url"`
}

type EventBeatmapset

type EventBeatmapset struct {
	Title string `json:"title"`
	URL   string `json:"url"`
}

type EventType

type EventType string
const (
	EventTypeAchievement       EventType = "achievement"
	EventTypeBeatmapPlaycount  EventType = "beatmapPlaycount"
	EventTypeBeatmapsetApprove EventType = "beatmapsetApprove"
	EventTypeBeatmapsetDelete  EventType = "beatmapsetDelete"
	EventTypeBeatmapsetRevive  EventType = "beatmapsetRevive"
	EventTypeBeatmapsetUpdate  EventType = "beatmapsetUpdate"
	EventTypeBeatmapsetUpload  EventType = "beatmapsetUpload"
	EventTypeRank              EventType = "rank"
	EventTypeRankLost          EventType = "rankLost"
	EventTypeUserSupportAgain  EventType = "userSupportAgain"
	EventTypeUserSupportFirst  EventType = "userSupportFirst"
	EventTypeUserSupportGift   EventType = "userSupportGift"
	EventTypeUsernameChange    EventType = "usernameChange"
)

type EventUser

type EventUser struct {
	Username         string  `json:"username"`
	URL              string  `json:"url"`
	PreviousUsername *string `json:"previousUsername,omitempty"`
}

type FailTimes

type FailTimes struct {
	Exit *[]int `json:"exit"`
	Fail *[]int `json:"fail"`
}

type FruitsDifficultyAttributes

type FruitsDifficultyAttributes struct {
	ApproachRate float32 `json:"approach_rate"`
}

type GenericDifficultyAttributes

type GenericDifficultyAttributes struct {
	Attributes json.RawMessage `json:"attributes"`
}

type Genre

type Genre int
const (
	GenreAny Genre = iota
	GenreUnspecified
	GenreVideoGame
	GenreAnime
	GenreRock
	GenrePop
	GenreOther
	GenreNovelty
	GenreHipHop Genre = iota + 1
	GenreElectronic
	GenreMetal
	GenreClassical
	GenreFolk
	GenreJazz
)

type GetBeatmapsResponse

type GetBeatmapsResponse struct {
	Beatmaps []BeatmapResponse `json:"beatmaps"`
}

type GetUsersResponse

type GetUsersResponse struct {
	Users []struct {
		UserCompact
		Country            `json:"country"`
		Cover              `json:"cover"`
		Groups             []UserGroup        `json:"groups"`
		StatisticsRulesets StatisticsRulesets `json:"statistics_rulesets"`
	} `json:"users"`
}

type GithubUser

type GithubUser struct {
	DisplayName    string  `json:"display_name"`
	GithubURL      *string `json:"github_url"`
	GithubUsername *string `json:"github_username"`
	ID             *int    `json:"id"`
	OsuUsername    *string `json:"osu_username"`
	UserID         *int    `json:"user_id"`
	UserURL        *string `json:"user_url"`
}

type Grade

type Grade string
const (
	GradeSS  Grade = "SS"
	GradeSSH Grade = "SSH"
	GradeS   Grade = "S"
	GradeSH  Grade = "SH"
	GradeA   Grade = "A"
	GradeB   Grade = "B"
	GradeC   Grade = "C"
	GradeD   Grade = "D"
	GradeF   Grade = "F"
)

type GradeCounts

type GradeCounts struct {
	A   int `json:"a"`
	S   int `json:"s"`
	Sh  int `json:"sh"`
	Ss  int `json:"ss"`
	Ssh int `json:"ssh"`
}

type Group

type Group struct {
	Colour         string `json:"colour"`
	HasListing     bool   `json:"has_listing"`
	HasPlaymodes   bool   `json:"has_playmodes"`
	ID             int    `json:"id"`
	Identifier     string `json:"identifier"`
	IsProbationary bool   `json:"is_probationary"`
	Name           string `json:"name"`
	ShortName      string `json:"short_name"`
}

type HistoryType

type HistoryType string
const (
	HistoryTypeNote          HistoryType = "note"
	HistoryTypeRestriction   HistoryType = "restriction"
	HistoryTypeSilence       HistoryType = "silence"
	HistoryTypeTournamentBan HistoryType = "tournament_ban"
)

type KudosuGiver

type KudosuGiver struct {
	URL      string `json:"url"`
	Username string `json:"username"`
}

type KudosuHistory

type KudosuHistory struct {
	ID        int          `json:"id"`
	Action    string       `json:"action"`
	Amount    int          `json:"amount"`
	Model     string       `json:"model"`
	CreatedAt time.Time    `json:"created_at"`
	Giver     *KudosuGiver `json:"giver"`
	Post      KudosuPost   `json:"post"`
}

type KudosuPost

type KudosuPost struct {
	URL   *string `json:"url"`
	Title string  `json:"title"`
}

type KudosuRankingRequest

type KudosuRankingRequest struct {
	Page *int `json:"page"`
	// contains filtered or unexported fields
}

func (*KudosuRankingRequest) Build

func (*KudosuRankingRequest) SetPage

func (r *KudosuRankingRequest) SetPage(page int) *KudosuRankingRequest

type KudosuRankingResponse

type KudosuRankingResponse struct {
	Ranking []struct {
		UserCompact
		Kudosu UserKudosu `json:"kudosu"`
	} `json:"ranking"`
}

type Language

type Language int
const (
	LanguageAny Language = iota
	LanguageOther
	LanguageEnglish
	LanguageJapanese
	LanguageChinese
	LanguageInstrumental
	LanguageKorean
	LanguageFrench
	LanguageGerman
	LanguageSwedish
	LanguageSpanish
	LanguageItalian
	LanguageRussian
	LanguagePolish
	LanguageUnspecified
)

type LookupBeatmapRequest

type LookupBeatmapRequest struct {
	Checksum *string
	Filename *string
	ID       *int
	// contains filtered or unexported fields
}

func (*LookupBeatmapRequest) Build

func (*LookupBeatmapRequest) SetChecksum

func (r *LookupBeatmapRequest) SetChecksum(checksum string) *LookupBeatmapRequest

func (*LookupBeatmapRequest) SetFilename

func (r *LookupBeatmapRequest) SetFilename(filename string) *LookupBeatmapRequest

func (*LookupBeatmapRequest) SetID

type LookupBeatmapsetResponse

type LookupBeatmapsetResponse struct {
	Beatmapset
	Beatmaps []struct {
		Beatmap
		Checksum  string `json:"checksum"`
		FailTimes `json:"failtimes"`
		MaxCombo  int `json:"max_combo"`
	} `json:"beatmaps"`
	Converts []struct {
		Beatmap
		Checksum  string `json:"checksum"`
		FailTimes `json:"failtimes"`
	} `json:"converts"`
	CurrentNominations []Nomination `json:"current_nominations"`
	Description        struct {
		Description string `json:"description"`
	} `json:"description"`
	BeatmapsetGenre    `json:"genre"`
	BeatmapsetLanguage `json:"language"`
	PackTags           []string      `json:"pack_tags"`
	Ratings            []int         `json:"ratings"`
	RecentFavourites   []UserCompact `json:"recent_favourites"`
	RelatedUsers       []UserCompact `json:"related_users"`
	User               UserCompact   `json:"user"`
}

type LookupChangelogBuildRequest

type LookupChangelogBuildRequest struct {
	Changelog      string
	Key            *string
	MessageFormats []MessageFormat
	// contains filtered or unexported fields
}

func (*LookupChangelogBuildRequest) Build

func (*LookupChangelogBuildRequest) SetKey

func (*LookupChangelogBuildRequest) SetMessageFormats

func (r *LookupChangelogBuildRequest) SetMessageFormats(messageFormats []MessageFormat) *LookupChangelogBuildRequest

type LookupChangelogBuildResponse

type LookupChangelogBuildResponse struct {
	Build
	ChangelogEntries []struct {
		ChangelogEntry
		GithubUser  GithubUser `json:"github_user"`
		Message     *string    `json:"message"`
		MessageHTML *string    `json:"message_html"`
	} `json:"changelog_entries"`
	Versions BuildVersions `json:"versions"`
}

type ManiaDifficultyAttributes

type ManiaDifficultyAttributes struct {
	GreatHitWindow float32 `json:"great_hit_window"`
}

type Medal

type Medal struct {
	Description  string   `json:"description"`
	Grouping     string   `json:"grouping"`
	IconURL      string   `json:"icon_url"`
	Instructions string   `json:"instructions"`
	MedalID      int      `json:"id"`
	Mode         *Ruleset `json:"mode"`
	Name         string   `json:"name"`
	Ordering     int      `json:"ordering"`
	Slug         string   `json:"slug"`
}

type MedalEvent

type MedalEvent struct {
	Achievement Medal     `json:"achievement"`
	User        EventUser `json:"user"`
}

type MessageFormat

type MessageFormat string

type MessageType

type MessageType string

type Mod

type Mod int
const (
	NF Mod = 1 << iota
	EZ
	TD
	HD
	HR
	SD
	DT
	RX
	HT
	NC
	FL
	AT
	SO
	AP
	PF
	K4
	K5
	K6
	K7
	K8
	FI
	RN
	CN
	TR
	K9
	KC
	K1
	K3
	K2
	SV2
	MR
)

type MonthlyPlaycount

type MonthlyPlaycount struct {
	StartDate string `json:"start_date"`
	Count     int    `json:"count"`
}

type MultiplayerScore

type MultiplayerScore struct {
	ID             int                        `json:"id"`
	UserID         int                        `json:"user_id"`
	RoomID         int                        `json:"room_id"`
	PlaylistItemID int                        `json:"playlist_item_id"`
	BeatmapID      int                        `json:"beatmap_id"`
	Rank           Grade                      `json:"rank"`
	TotalScore     int                        `json:"total_score"`
	Accuracy       float32                    `json:"accuracy"`
	MaxCombo       int                        `json:"max_combo"`
	Mods           []MultiplayerScoreMod      `json:"mods"`
	Statistics     MultiplayerScoreStatistics `json:"statistics"`
	Passed         bool                       `json:"passed"`
	Position       *int                       `json:"position"`
	User           struct {
		UserCompact
		Country Country `json:"country"`
		Cover   Cover   `json:"cover"`
	} `json:"user"`
}

type MultiplayerScoreMod

type MultiplayerScoreMod struct {
	Acronym Mod `json:"acronym"`
}

type MultiplayerScoreStatistics

type MultiplayerScoreStatistics struct {
	ComboBreak int `json:"combo_break"`
	Good       int `json:"good"`
	Great      int `json:"great"`
	IgnoreHit  int `json:"ignore_hit"`
	IgnoreMiss int `json:"ignore_miss"`
	Meh        int `json:"meh"`
	Miss       int `json:"miss"`
	Ok         int `json:"ok"`
	Perfect    int `json:"perfect"`
}

type MultiplayerScores

type MultiplayerScores struct {
	CursorString Cursor                  `json:"cursor"`
	Params       MultiplayerScoresParams `json:"params"`
	Scores       []MultiplayerScore      `json:"scores"`
	Total        *int                    `json:"total"`
	UserScore    *MultiplayerScore       `json:"user_score"`
}

type MultiplayerScoresParams

type MultiplayerScoresParams struct {
	Limit int                   `json:"limit"`
	Sort  MultiplayerScoresSort `json:"sort"`
}

type MultiplayerScoresSort

type MultiplayerScoresSort string

type NewsListingRequest

type NewsListingRequest struct {
	Limit *int
	Year  *int
	// contains filtered or unexported fields
}

func (*NewsListingRequest) Build

func (*NewsListingRequest) SetLimit

func (r *NewsListingRequest) SetLimit(limit int) *NewsListingRequest

func (*NewsListingRequest) SetYear

func (r *NewsListingRequest) SetYear(year int) *NewsListingRequest

type NewsListingResponse

type NewsListingResponse struct {
	CursorString Cursor `json:"cursor_string"`
	NewsPosts    []struct {
		NewsPost
		Preview string `json:"preview"`
	} `json:"news_posts"`
	NewsSidebar NewsSidebar `json:"news_sidebar"`
	Search      NewsSearch  `json:"search"`
}

type NewsNavigation

type NewsNavigation struct {
	Newer *NewsPost `json:"newer,omitempty"`
	Older *NewsPost `json:"older,omitempty"`
}

type NewsPost

type NewsPost struct {
	Author      string    `json:"author"`
	EditUrl     string    `json:"edit_url"`
	FirstImage  *string   `json:"first_image"`
	ID          int       `json:"id"`
	PublishedAt time.Time `json:"published_at"`
	Slug        string    `json:"slug"`
	Title       string    `json:"title"`
	UpdatedAt   time.Time `json:"updated_at"`
}

type NewsPostRequest

type NewsPostRequest struct {
	News string
	Key  *string
	// contains filtered or unexported fields
}

func (*NewsPostRequest) Build

func (r *NewsPostRequest) Build() (*NewsPostResponse, error)

func (*NewsPostRequest) SetKey

func (r *NewsPostRequest) SetKey(key string) *NewsPostRequest

type NewsPostResponse

type NewsPostResponse struct {
	NewsPost
	Content    string         `json:"content"`
	Navigation NewsNavigation `json:"navigation"`
}

type NewsSearch

type NewsSearch struct {
	Limit int    `json:"limit"`
	Sort  string `json:"sort"`
	Year  int    `json:"year"`
}

type NewsSidebar

type NewsSidebar struct {
	CurrentYear int        `json:"current_year"`
	NewsPost    []NewsPost `json:"news_posts"`
	Years       []int      `json:"years"`
}

type Nomination

type Nomination struct {
	BeatmapsetID int       `json:"beatmapset_id"`
	Rulesets     []Ruleset `json:"rulesets"`
	Reset        bool      `json:"reset"`
	UserID       int       `json:"user_id"`
}

type OsuDifficultyAttributes

type OsuDifficultyAttributes struct {
	AimDifficulty        float32 `json:"aim_difficulty"`
	SpeedDifficulty      float32 `json:"speed_difficulty"`
	SpeedNoteCount       float32 `json:"speed_note_count"`
	FlashlightDifficulty float32 `json:"flashlight_difficulty"`
	SliderFactor         float32 `json:"slider_factor"`
	ApproachRate         float32 `json:"approach_rate"`
	OverallDifficulty    float32 `json:"overall_difficulty"`
}

type OwnDataRequest

type OwnDataRequest struct {
	Mode *Ruleset
	// contains filtered or unexported fields
}

func (*OwnDataRequest) Build

func (r *OwnDataRequest) Build() (*OwnDataResponse, error)

func (*OwnDataRequest) SetMode

func (r *OwnDataRequest) SetMode(mode Ruleset) *OwnDataRequest

type OwnDataResponse

type OwnDataResponse struct {
	UserExtended
	IsRestricted       bool               `json:"is_restricted"`
	SessionVerified    bool               `json:"session_verified"`
	StatisticsRulesets StatisticsRulesets `json:"statistics_rulesets"`
}

type Page

type Page struct {
	HTML string `json:"html"`
	Raw  string `json:"raw"`
}

type PlaylistScoresRequest

type PlaylistScoresRequest struct {
	Room         int
	Playlist     int
	Limit        *int
	Sort         *MultiplayerScoresSort
	CursorString *string
	// contains filtered or unexported fields
}

func (*PlaylistScoresRequest) Build

func (*PlaylistScoresRequest) SetCursorString

func (r *PlaylistScoresRequest) SetCursorString(cursorString string) *PlaylistScoresRequest

func (*PlaylistScoresRequest) SetLimit

func (r *PlaylistScoresRequest) SetLimit(limit int) *PlaylistScoresRequest

func (*PlaylistScoresRequest) SetSort

type Playstyle

type Playstyle string
const (
	PlaystyleMouse    Playstyle = "mouse"
	PlaystyleKeyboard Playstyle = "keyboard"
	PlaystyleTablet   Playstyle = "tablet"
	PlaystyleTouch    Playstyle = "touch"
)

type ProfilePage

type ProfilePage string
const (
	ProfilePageMe             ProfilePage = "me"
	ProfilePageRecentActivity ProfilePage = "recent_activity"
	ProfilePageBeatmaps       ProfilePage = "beatmaps"
	ProfilePageHistorical     ProfilePage = "historical"
	ProfilePageKudosu         ProfilePage = "kudosu"
	ProfilePageTopRanks       ProfilePage = "top_ranks"
	ProfilePageMedals         ProfilePage = "medals"
)

type RankEvent

type RankEvent struct {
	Grade   Grade        `json:"scoreRank"`
	Rank    int          `json:"rank"`
	Mode    Ruleset      `json:"mode"`
	Beatmap EventBeatmap `json:"beatmap"`
	User    EventUser    `json:"user"`
}

type RankHighest

type RankHighest struct {
	Rank      int       `json:"rank"`
	UpdatedAt time.Time `json:"updated_at"`
}

type RankHistory

type RankHistory struct {
	Mode Ruleset `json:"mode"`
	Data []int   `json:"data"`
}

type RankLostEvent

type RankLostEvent struct {
	Mode    Ruleset      `json:"mode"`
	Beatmap EventBeatmap `json:"beatmap"`
	User    EventUser    `json:"user"`
}

type RankStatus

type RankStatus int

ENUM(graveyard = -2, WIP, pending, ranked, approved, qualified, loved)

const (
	// RankStatusGraveyard is a RankStatus of type Graveyard.
	RankStatusGraveyard RankStatus = iota + -2
	// RankStatusWIP is a RankStatus of type WIP.
	RankStatusWIP
	// RankStatusPending is a RankStatus of type Pending.
	RankStatusPending
	// RankStatusRanked is a RankStatus of type Ranked.
	RankStatusRanked
	// RankStatusApproved is a RankStatus of type Approved.
	RankStatusApproved
	// RankStatusQualified is a RankStatus of type Qualified.
	RankStatusQualified
	// RankStatusLoved is a RankStatus of type Loved.
	RankStatusLoved
)

func ParseRankStatus

func ParseRankStatus(name string) (RankStatus, error)

ParseRankStatus attempts to convert a string to a RankStatus.

func (RankStatus) IsValid

func (x RankStatus) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (RankStatus) MarshalText

func (x RankStatus) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (RankStatus) String

func (x RankStatus) String() string

String implements the Stringer interface.

func (*RankStatus) UnmarshalText

func (x *RankStatus) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

type RankingFilter

type RankingFilter string
const (
	RankingFilterAll     RankingFilter = "all"
	RankingFilterFriends RankingFilter = "friends"
)

type RankingRequest

type RankingRequest struct {
	Mode      Ruleset
	Type      RankingType
	Country   *string
	Filter    *RankingFilter
	Spotlight *int
	Variant   *RankingVariant
	// contains filtered or unexported fields
}

func (*RankingRequest) Build

func (r *RankingRequest) Build() (*Rankings, error)

func (*RankingRequest) SetCountry

func (r *RankingRequest) SetCountry(country string) *RankingRequest

func (*RankingRequest) SetFilter

func (r *RankingRequest) SetFilter(filter RankingFilter) *RankingRequest

func (*RankingRequest) SetSpotlight

func (r *RankingRequest) SetSpotlight(spotlight int) *RankingRequest

func (*RankingRequest) SetVariant

func (r *RankingRequest) SetVariant(variant RankingVariant) *RankingRequest

type RankingType

type RankingType string
const (
	RankingTypeCharts      RankingType = "charts"
	RankingTypeCountry     RankingType = "country"
	RankingTypePerformance RankingType = "performance"
	RankingTypeScore       RankingType = "score"
)

type RankingVariant

type RankingVariant string

type Rankings

type Rankings struct {
	Beatmapsets *[]Beatmapset `json:"beatmapsets,omitempty"`
	Cursor      Cursor        `json:"cursor"`
	Ranking     []struct {
		UserStatistics
		User struct {
			UserCompact
			Country Country `json:"country"`
			Cover   Cover   `json:"cover"`
		} `json:"user"`
	} `json:"ranking"`
	Spotlight *Spotlight `json:"spotlight,omitempty"`
	Total     int        `json:"total"`
}

type Ruleset

type Ruleset int

ENUM(osu, taiko, fruits, mania)

const (
	// RulesetOsu is a Ruleset of type Osu.
	RulesetOsu Ruleset = iota
	// RulesetTaiko is a Ruleset of type Taiko.
	RulesetTaiko
	// RulesetFruits is a Ruleset of type Fruits.
	RulesetFruits
	// RulesetMania is a Ruleset of type Mania.
	RulesetMania
)

func ParseRuleset

func ParseRuleset(name string) (Ruleset, error)

ParseRuleset attempts to convert a string to a Ruleset.

func (Ruleset) IsValid

func (x Ruleset) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (Ruleset) MarshalText

func (x Ruleset) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (Ruleset) String

func (x Ruleset) String() string

String implements the Stringer interface.

func (*Ruleset) UnmarshalText

func (x *Ruleset) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

type Score

type Score struct {
	ID         int             `json:"id"`
	UserID     int             `json:"user_id"`
	Accuracy   float64         `json:"accuracy"`
	Mods       []string        `json:"mods"`
	Score      int             `json:"score"`
	MaxCombo   int             `json:"max_combo"`
	Perfect    bool            `json:"perfect"`
	Statistics ScoreStatistics `json:"statistics"`
	Passed     bool            `json:"passed"`
	Pp         float32         `json:"pp"`
	Rank       Grade           `json:"rank"`
	CreatedAt  time.Time       `json:"created_at"`
	Mode       Ruleset         `json:"mode"`
	ModeInt    int             `json:"mode_int"`
	Replay     bool            `json:"replay"`
}

type ScoreStatistics

type ScoreStatistics 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 ScoreType

type ScoreType string
const (
	ScoreTypeBest   ScoreType = "best"
	ScoreTypeFirsts ScoreType = "firsts"
	ScoreTypePinned ScoreType = "pinned"
	ScoreTypeRecent ScoreType = "recent"
)

type ScoreWeight

type ScoreWeight struct {
	Percentage float32 `json:"percentage"`
	PP         float32 `json:"pp"`
}

type Sort

type Sort string

type Spotlight

type Spotlight struct {
	EndDate          time.Time     `json:"end_date"`
	ID               int           `json:"id"`
	ModeSpecific     bool          `json:"mode_specific"`
	ParticipantCount *int          `json:"participant_count,omitempty"`
	Name             string        `json:"name"`
	StartDate        time.Time     `json:"start_date"`
	Type             SpotlightType `json:"type"`
}

type SpotlightType

type SpotlightType string
const (
	SpotlightTypeMonthly   SpotlightType = "monthly"
	SpotlightTypeSpotlight SpotlightType = "spotlight"
	SpotlightTypeTheme     SpotlightType = "theme"
	SpotlightTypeSpecial   SpotlightType = "special"
	SpotlightTypeBestOf    SpotlightType = "bestof"
)

type Spotlights

type Spotlights struct {
	Spotlights []Spotlight `json:"spotlights"`
}

type SpotlightsRequest

type SpotlightsRequest struct {
	// contains filtered or unexported fields
}

func (*SpotlightsRequest) Build

func (r *SpotlightsRequest) Build() (*Spotlights, error)

type StatisticsRulesets

type StatisticsRulesets map[Ruleset]*UserStatistics

type SupportAgainEvent

type SupportAgainEvent struct {
	User EventUser `json:"user"`
}

type SupportFirstEvent

type SupportFirstEvent struct {
	User EventUser `json:"user"`
}

type SupportGiftEvent

type SupportGiftEvent struct {
	User EventUser `json:"user"`
}

type TaikoDifficultyAttributes

type TaikoDifficultyAttributes struct {
	StaminaDifficulty float32 `json:"stamina_difficulty"`
	RhythmDifficulty  float32 `json:"rhythm_difficulty"`
	ColourDifficulty  float32 `json:"colour_difficulty"`
	PeakDifficulty    float32 `json:"peak_difficulty"`
	GreatHitWindow    float32 `json:"great_hit_window"`
}

type UpdateStream

type UpdateStream struct {
	DisplayName *string `json:"display_name"`
	ID          int     `json:"id"`
	IsFeatured  bool    `json:"is_featured"`
	Name        string  `json:"name"`
}

type User

type User struct {
	UserCompact
	Country      Country       `json:"country"`
	Cover        Cover         `json:"cover"`
	Discord      *string       `json:"discord"`
	HasSupported bool          `json:"has_supported"`
	Interests    *string       `json:"interests"`
	JoinDate     time.Time     `json:"join_date"`
	Kudosu       UserKudosu    `json:"kudosu"`
	Location     string        `json:"location"`
	MaxBlocks    int           `json:"max_blocks"`
	MaxFriends   int           `json:"max_friends"`
	Occupation   *string       `json:"occupation"`
	Playmode     Ruleset       `json:"playmode"`
	Playstyle    []Playstyle   `json:"playstyle"`
	PostCount    int           `json:"post_count"`
	ProfileOrder []ProfilePage `json:"profile_order"`
	Title        *string       `json:"title"`
	TitleURL     *string       `json:"title_url"`
	Twitter      *string       `json:"twitter"`
	Website      *string       `json:"website"`
}

type UserAccountHistory

type UserAccountHistory struct {
	Description string      `json:"description"`
	ID          int         `json:"id"`
	Length      int         `json:"length"`
	Permanent   bool        `json:"permanent"`
	Timestamp   string      `json:"timestamp"`
	Type        HistoryType `json:"type"`
}

type UserAchievement

type UserAchievement struct {
	AchievedAt    time.Time `json:"achieved_at"`
	AchievementID int       `json:"achievement_id"`
}

type UserActiveTournamentBanner

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

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 UserBeatmapScore

type UserBeatmapScore struct {
	Position int `json:"position"`
	Score    struct {
		Score
		Beatmap struct {
			Beatmap
			Checksum string `json:"checksum"`
		} `json:"beatmap"`
		User struct {
			Country `json:"country"`
			Cover   `json:"cover"`
		} `json:"user"`
	} `json:"score"`
}

type UserBeatmapScoreRequest

type UserBeatmapScoreRequest struct {
	Beatmap int
	User    int
	Mode    *Ruleset
	// contains filtered or unexported fields
}

func (*UserBeatmapScoreRequest) Build

func (*UserBeatmapScoreRequest) SetMode

type UserBeatmapScores

type UserBeatmapScores struct {
	Scores []Score `json:"scores"`
}

type UserBeatmapScoresRequest

type UserBeatmapScoresRequest struct {
	Beatmap int
	User    int
	Mode    *Ruleset
	// contains filtered or unexported fields
}

func (*UserBeatmapScoresRequest) Build

func (*UserBeatmapScoresRequest) SetMode

type UserBeatmapsRequest

type UserBeatmapsRequest struct {
	User    int
	MapType string
	Limit   *int
	Offset  *int
	// contains filtered or unexported fields
}

func (*UserBeatmapsRequest) Build

func (r *UserBeatmapsRequest) Build() (*[]UserBeatmapset, error)

func (*UserBeatmapsRequest) SetLimit

func (r *UserBeatmapsRequest) SetLimit(limit int) *UserBeatmapsRequest

func (*UserBeatmapsRequest) SetOffset

func (r *UserBeatmapsRequest) SetOffset(offset int) *UserBeatmapsRequest

type UserBeatmapset

type UserBeatmapset struct {
	Beatmapset
	Beatmaps []struct {
		Beatmap
		Checksum string `json:"checksum"`
	} `json:"beatmaps"`
}

type UserCompact

type UserCompact struct {
	AvatarURL     string     `json:"avatar_url"`
	CountryCode   string     `json:"country_code"`
	DefaultGroup  *string    `json:"default_group"`
	ID            int        `json:"id"`
	IsActive      bool       `json:"is_active"`
	IsBot         bool       `json:"is_bot"`
	IsDeleted     bool       `json:"is_deleted"`
	IsOnline      bool       `json:"is_online"`
	IsSupporter   bool       `json:"is_supporter"`
	LastVisit     *time.Time `json:"last_visit"`
	PmFriendsOnly bool       `json:"pm_friends_only"`
	ProfileColour *string    `json:"profile_colour"`
	Username      string     `json:"username"`
}

type UserExtended

type UserExtended struct {
	User
	AccountHistory           []UserAccountHistory        `json:"account_history"`
	ActiveTournamentBanner   *UserActiveTournamentBanner `json:"active_tournament_banners"`
	Badges                   []UserBadge                 `json:"badges"`
	BeatmapPlaycountsCount   int                         `json:"beatmap_playcounts_count"`
	FavouriteBeatmapsetCount int                         `json:"favourite_beatmapset_count"`
	FollowerCount            int                         `json:"follower_count"`
	GraveyardBeatmapsetCount int                         `json:"graveyard_beatmapset_count"`
	Groups                   []UserGroup                 `json:"groups"`
	LovedBeatmapsetCount     int                         `json:"loved_beatmapset_count"`
	MappingFollowerCount     int                         `json:"mapping_follower_count"`
	MonthlyPlaycounts        []MonthlyPlaycount          `json:"monthly_playcounts"`
	Page                     Page                        `json:"page"`
	PendingBeatmapsetCount   int                         `json:"pending_beatmapset_count"`
	PreviousUsernames        []string                    `json:"previous_usernames"`
	RankHighest              *RankHighest                `json:"rank_highest"`
	RankHistory              RankHistory                 `json:"rank_history"`
	RankedBeatmapsetCount    int                         `json:"ranked_beatmapset_count"`
	ReplaysWatchedCounts     []MonthlyPlaycount          `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"`
	SupportLevel             int                         `json:"support_level"`
	UserAchievements         []UserAchievement           `json:"user_achievements"`
}

type UserGroup

type UserGroup struct {
	Group
	Playmodes []Ruleset `json:"playmodes"`
}

type UserKudosu

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

type UserKudosuRequest

type UserKudosuRequest struct {
	User   int
	Limit  *int
	Offset *int
	// contains filtered or unexported fields
}

func (*UserKudosuRequest) Build

func (r *UserKudosuRequest) Build() (*[]KudosuHistory, error)

func (*UserKudosuRequest) SetLimit

func (r *UserKudosuRequest) SetLimit(limit int) *UserKudosuRequest

func (*UserKudosuRequest) SetOffset

func (r *UserKudosuRequest) SetOffset(offset int) *UserKudosuRequest

type UserLevel

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

type UserMostPlayedRequest

type UserMostPlayedRequest struct {
	User   int
	Limit  *int
	Offset *int
	// contains filtered or unexported fields
}

func (*UserMostPlayedRequest) Build

func (*UserMostPlayedRequest) SetLimit

func (r *UserMostPlayedRequest) SetLimit(limit int) *UserMostPlayedRequest

func (*UserMostPlayedRequest) SetOffset

func (r *UserMostPlayedRequest) SetOffset(offset int) *UserMostPlayedRequest

type UserMostPlayedResponse

type UserMostPlayedResponse struct {
	BeatmapID  int                `json:"beatmap_id"`
	Beatmap    *BeatmapCompact    `json:"beatmap"`
	Beatmapset *BeatmapsetCompact `json:"beatmapset"`
	Count      int                `json:"count"`
}

type UserRecentActivityRequest

type UserRecentActivityRequest struct {
	User   int
	Limit  *int
	Offset *int
	// contains filtered or unexported fields
}

func (*UserRecentActivityRequest) Build

func (r *UserRecentActivityRequest) Build() (*[]EventBase, error)

func (*UserRecentActivityRequest) SetLimit

func (*UserRecentActivityRequest) SetOffset

type UserRequest

type UserRequest struct {
	User string
	Mode *Ruleset
	// contains filtered or unexported fields
}

func (*UserRequest) Build

func (r *UserRequest) Build() (*UserExtended, error)

func (*UserRequest) SetMode

func (r *UserRequest) SetMode(mode Ruleset) *UserRequest

type UserScore

type UserScore struct {
	Score
	Beatmap struct {
		Beatmap
		Checksum *string `json:"checksum"`
	} `json:"beatmap"`
	Beatmapset BeatmapsetCompact `json:"beatmapset"`
	User       UserCompact       `json:"user"`
	Weight     *ScoreWeight      `json:"weight"`
}

type UserScoresRequest

type UserScoresRequest struct {
	User         int
	Type         ScoreType
	IncludeFails *bool
	Mode         *Ruleset
	Limit        *int
	Offset       *int
	// contains filtered or unexported fields
}

func (*UserScoresRequest) Best

func (*UserScoresRequest) Build

func (r *UserScoresRequest) Build() (*[]UserScore, error)

func (*UserScoresRequest) Firsts

func (r *UserScoresRequest) Firsts() *UserScoresRequest

func (*UserScoresRequest) Pinned

func (r *UserScoresRequest) Pinned() *UserScoresRequest

func (*UserScoresRequest) Recent

func (r *UserScoresRequest) Recent() *UserScoresRequest

func (*UserScoresRequest) SetIncludeFails

func (r *UserScoresRequest) SetIncludeFails(includeFails bool) *UserScoresRequest

func (*UserScoresRequest) SetLimit

func (r *UserScoresRequest) SetLimit(limit int) *UserScoresRequest

func (*UserScoresRequest) SetOffset

func (r *UserScoresRequest) SetOffset(offset int) *UserScoresRequest

type UserStatistics

type UserStatistics struct {
	Count100               int         `json:"count_100"`
	Count300               int         `json:"count_300"`
	Count50                int         `json:"count_50"`
	CountMiss              int         `json:"count_miss"`
	GradeCounts            GradeCounts `json:"grade_counts"`
	HitAccuracy            float64     `json:"hit_accuracy"`
	IsRanked               bool        `json:"is_ranked"`
	Level                  UserLevel   `json:"level"`
	MaximumCombo           int         `json:"maximum_combo"`
	PlayCount              int         `json:"play_count"`
	PlayTime               int         `json:"play_time"`
	PP                     float64     `json:"pp"`
	GlobalRank             *int        `json:"global_rank"`
	RankedScore            int         `json:"ranked_score"`
	ReplaysWatchedByOthers int         `json:"replays_watched_by_others"`
	TotalHits              int         `json:"total_hits"`
	TotalScore             int         `json:"total_score"`
	CountryRank            *int        `json:"country_rank"`
}

type UsernameChangeEvent

type UsernameChangeEvent struct {
	User EventUser `json:"user"`
}

type UsersRequest

type UsersRequest struct {
	Users []int
	// contains filtered or unexported fields
}

func (*UsersRequest) Build

func (r *UsersRequest) Build() (*GetUsersResponse, error)

type WikiPage

type WikiPage struct {
	AvailableLocales []string `json:"available_locales"`
	Layout           string   `json:"layout"`
	Locale           string   `json:"locale"`
	Markdown         string   `json:"markdown"`
	Path             string   `json:"path"`
	Subtitle         *string  `json:"subtitle"`
	Tags             []string `json:"tags"`
	Title            string   `json:"title"`
}

type WikiPageRequest

type WikiPageRequest struct {
	Locale string
	Path   string
	// contains filtered or unexported fields
}

func (*WikiPageRequest) Build

func (r *WikiPageRequest) Build() (*WikiPage, error)

Jump to

Keyboard shortcuts

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