Documentation ¶
Index ¶
- Variables
- type Availability
- type Beatmap
- type BeatmapAPI
- type BeatmapSet
- type BeatmapSetAPI
- type BeatmapSetFull
- type Covers
- type CurrentUserAttributes
- type DefaultGroup
- type Description
- type Failtimes
- type Genre
- type Hype
- type Mode
- type OAuth2API
- type Oauth2Token
- type OsuAPI
- type SingleBeatmap
- type Status
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Default api domain // Can be change before create api client APIDomain = "https://osu.ppy.sh" // OAuth2 client id // Required for create access_token or refresh its APIClientId = "5" // OAuth2 client secret APIClientSecret = "FGc9GAtyHzeQDshWP5Ah7dega8hJACAJpQtw6OXk" )
Functions ¶
This section is empty.
Types ¶
type Availability ¶ added in v1.1.0
type Beatmap ¶ added in v1.1.0
type Beatmap struct { ID int64 `json:"id"` BeatmapsetID int64 `json:"beatmapset_id"` Mode Mode `json:"mode"` ModeInt int64 `json:"mode_int"` Convert bool `json:"convert"` DifficultyRating float64 `json:"difficulty_rating"` Version string `json:"version"` TotalLength int64 `json:"total_length"` HitLength int64 `json:"hit_length"` BPM float64 `json:"bpm"` CS float64 `json:"cs"` Drain float64 `json:"drain"` Accuracy float64 `json:"accuracy"` Ar float64 `json:"ar"` Playcount int64 `json:"playcount"` Passcount int64 `json:"passcount"` CountCircles int64 `json:"count_circles"` CountSliders int64 `json:"count_sliders"` CountSpinners int64 `json:"count_spinners"` CountTotal int64 `json:"count_total"` IsScoreable bool `json:"is_scoreable"` LastUpdated time.Time `json:"last_updated"` Ranked int64 `json:"ranked"` Status Status `json:"status"` URL string `json:"url"` DeletedAt time.Time `json:"deleted_at"` Failtimes Failtimes `json:"failtimes"` MaxCombo *int64 `json:"max_combo"` }
type BeatmapAPI ¶ added in v1.1.0
type BeatmapAPI struct {
*OsuAPI
}
func (*BeatmapAPI) Get ¶ added in v1.1.0
func (b *BeatmapAPI) Get(id uint) (*SingleBeatmap, error)
Get general beatmap information by beatmapId
type BeatmapSet ¶ added in v1.1.0
type BeatmapSet struct { ID int64 `json:"id"` Title string `json:"title"` Artist string `json:"artist"` PlayCount int64 `json:"play_count"` FavouriteCount int64 `json:"favourite_count"` HasFavourited bool `json:"has_favourited"` SubmittedDate time.Time `json:"submitted_date"` LastUpdated time.Time `json:"last_updated"` RankedDate time.Time `json:"ranked_date"` Creator string `json:"creator"` UserID int64 `json:"user_id"` BPM float64 `json:"bpm"` Source string `json:"source"` Covers Covers `json:"covers"` PreviewURL string `json:"preview_url"` Tags string `json:"tags"` Video bool `json:"video"` Storyboard bool `json:"storyboard"` Ranked int64 `json:"ranked"` Status Status `json:"status"` IsScoreable bool `json:"is_scoreable"` DiscussionEnabled bool `json:"discussion_enabled"` DiscussionLocked bool `json:"discussion_locked"` CanBeHyped bool `json:"can_be_hyped"` Availability Availability `json:"availability"` Hype Hype `json:"hype"` Nominations Hype `json:"nominations"` LegacyThreadURL string `json:"legacy_thread_url"` Description Description `json:"description"` Genre Genre `json:"genre"` Language Genre `json:"language"` User User `json:"user"` Beatmaps []Beatmap `json:"beatmaps"` }
type BeatmapSetAPI ¶
type BeatmapSetAPI struct {
*OsuAPI
}
func (*BeatmapSetAPI) Get ¶
func (b *BeatmapSetAPI) Get(id uint) (*BeatmapSetFull, error)
type BeatmapSetFull ¶ added in v1.1.0
type BeatmapSetFull struct { BeatmapSet RecentFavourites []User `json:"recent_favourites"` CurrentUserAttributes CurrentUserAttributes `json:"current_user_attributes"` Ratings []int64 `json:"ratings"` Converts []Beatmap `json:"converts"` }
type CurrentUserAttributes ¶ added in v1.1.0
type CurrentUserAttributes struct { CanDelete bool `json:"can_delete"` CanHype bool `json:"can_hype"` CanHypeReason interface{} `json:"can_hype_reason"` CanLove bool `json:"can_love"` IsWatching bool `json:"is_watching"` NewHypeTime interface{} `json:"new_hype_time"` RemainingHype int64 `json:"remaining_hype"` }
type DefaultGroup ¶ added in v1.1.0
type DefaultGroup string
const (
Default DefaultGroup = "default"
)
type Description ¶ added in v1.1.0
type Description struct {
Description string `json:"description"`
}
type OAuth2API ¶ added in v1.1.0
type OAuth2API struct {
*OsuAPI
}
func (*OAuth2API) CreateToken ¶ added in v1.1.3
func (*OAuth2API) TokenRenew ¶ added in v1.1.0
type Oauth2Token ¶
type OsuAPI ¶
type OsuAPI struct { OAuth2 OAuth2API Beatmap BeatmapAPI BeatmapSet BeatmapSetAPI // contains filtered or unexported fields }
Package provide a simple interface to osu!api v2.
func WithAccessToken ¶
Create new api client WithAccessToken with enabled auto refreshing access_token by default uses APIDomain, APIClientId, APIClientSecret, variables to set the address and the client_id/client_secret
type SingleBeatmap ¶ added in v1.1.0
type SingleBeatmap struct { Beatmap Beatmapset BeatmapSet `json:"beatmapset"` }
type User ¶ added in v1.1.0
type User struct { ID int64 `json:"id"` Username string `json:"username"` ProfileColour string `json:"profile_colour"` AvatarURL string `json:"avatar_url"` CountryCode string `json:"country_code"` DefaultGroup DefaultGroup `json:"default_group"` IsActive bool `json:"is_active"` IsBot bool `json:"is_bot"` IsOnline bool `json:"is_online"` IsSupporter bool `json:"is_supporter"` LastVisit *string `json:"last_visit"` PmFriendsOnly bool `json:"pm_friends_only"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.