pkg

package
Version: v0.0.0-...-4a082d9 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Beatmap

type Beatmap struct {
	BeatmapSetID int `json:"beatmapset_id,string"`
	BeatmapID    int `json:"beatmap_id,string"`
	// Approved          ApprovedStatus `json:"approved,string"`
	TotalLength       int     `json:"total_length,string"`
	HitLength         int     `json:"hit_length,string"`
	DiffName          string  `json:"version"`
	FileMD5           string  `json:"file_md5"`
	CircleSize        float64 `json:"diff_size,string"`
	OverallDifficulty float64 `json:"diff_overall,string"`
	ApproachRate      float64 `json:"diff_approach,string"`
	HPDrain           float64 `json:"diff_drain,string"`
	Mode              Mode    `json:"mode,string"`
	// ApprovedDate      MySQLDate      `json:"approved_date"`
	// LastUpdate        MySQLDate      `json:"last_update"`
	Artist  string  `json:"artist"`
	Title   string  `json:"title"`
	Creator string  `json:"creator"`
	BPM     float64 `json:"bpm,string"`
	Source  string  `json:"source"`
	Tags    string  `json:"tags"`
	// Genre             Genre          `json:"genre_id,string"`
	// Language          Language       `json:"language_id,string"`
	FavouriteCount   int     `json:"favourite_count,string"`
	Playcount        int     `json:"playcount,string"`
	Passcount        int     `json:"passcount,string"`
	MaxCombo         int     `json:"max_combo,string"`
	DifficultyRating float64 `json:"difficultyrating,string"`
}

Beatmap is an osu! beatmap.

type Client

type Client struct {
	*gentleman.Client
}

Client contains all methods with configured http client.

func WithAPIKey

func WithAPIKey(key string) Client

WithAPIKey return configured osu!api client with all necessary information.

func (*Client) GetBeatmaps

func (cli *Client) GetBeatmaps(opts GetBeatmapsOpts) (*[]Beatmap, error)

GetBeatmaps makes a get_beatmaps request to the osu! API. https://github.com/ppy/osu-api/wiki#apiget_beatmaps

type GetBeatmapsOpts

type GetBeatmapsOpts struct {
	Since            *time.Time
	BeatmapSetID     int
	BeatmapID        int
	UserID           int
	Username         string
	Mode             *Mode
	IncludeConverted bool
	BeatmapHash      string
	Limit            int
}

GetBeatmapsOpts is a struct containing the GET query string parameters to an /api/get_beatmaps request.

type Mode

type Mode int

Mode is an osu! game mode.

const (
	ModeOsu Mode = iota
	ModeTaiko
	ModeCatchTheBeat
	ModeOsuMania
)

osu! game modes IDs.

func (Mode) String

func (m Mode) String() string

String transform from num to string name

Jump to

Keyboard shortcuts

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