v1

package
Version: v0.0.0-...-776aec6 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2020 License: AGPL-3.0 Imports: 32 Imported by: 0

Documentation

Overview

Package v1 implements the first version of the Ripple API.

Index

Constants

This section is empty.

Variables

View Source
var (
	Err500     = common.SimpleResponse(500, "An error occurred. Trying again may work. If it doesn't, yell at this Ripple instance admin and tell them to fix the API.")
	ErrBadJSON = common.SimpleResponse(400, "Your JSON for this request is invalid.")
)

Boilerplate errors

Functions

func BadgeMembersGET

func BadgeMembersGET(md common.MethodData) common.CodeMessager

BadgeMembersGET retrieves the people who have a certain badge.

func BadgesGET

func BadgesGET(md common.MethodData) common.CodeMessager

BadgesGET retrieves all the badges on this ripple instance.

func BeatmapGET

func BeatmapGET(md common.MethodData) common.CodeMessager

BeatmapGET retrieves a beatmap.

func BeatmapRankRequestsStatusGET

func BeatmapRankRequestsStatusGET(md common.MethodData) common.CodeMessager

BeatmapRankRequestsStatusGET gets the current status for beatmap ranking requests.

func BeatmapRankRequestsSubmitPOST

func BeatmapRankRequestsSubmitPOST(md common.MethodData) common.CodeMessager

BeatmapRankRequestsSubmitPOST submits a new beatmap for ranking approval.

func BeatmapRankedFrozenFullGET

func BeatmapRankedFrozenFullGET(md common.MethodData) common.CodeMessager

BeatmapRankedFrozenFullGET retrieves all beatmaps with a certain ranked_status_freezed

func BeatmapSetStatusPOST

func BeatmapSetStatusPOST(md common.MethodData) common.CodeMessager

BeatmapSetStatusPOST changes the ranked status of a beatmap, and whether the beatmap ranked status is frozen. Or freezed. Freezed best meme 2k16

func BlogPostsGET

func BlogPostsGET(md common.MethodData) common.CodeMessager

BlogPostsGET retrieves the latest blog posts on the Ripple blog.

func ErrBadField

func ErrBadField(badFields ...string) common.CodeMessager

ErrBadField generates a response to a request when some fields are invalid

func ErrMissingField

func ErrMissingField(missingFields ...string) common.CodeMessager

ErrMissingField generates a response to a request when some fields in the JSON are missing.

func FriendsAddPOST

func FriendsAddPOST(md common.MethodData) common.CodeMessager

FriendsAddPOST adds an user to the friends.

func FriendsDelPOST

func FriendsDelPOST(md common.MethodData) common.CodeMessager

FriendsDelPOST deletes an user's friend.

func FriendsGET

func FriendsGET(md common.MethodData) common.CodeMessager

FriendsGET is the API request handler for GET /friends. It retrieves an user's friends, and whether the friendship is mutual or not.

func FriendsWithGET

func FriendsWithGET(md common.MethodData) common.CodeMessager

FriendsWithGET checks the current user is friends with the one passed in the request path.

func Handle404

func Handle404(c *fasthttp.RequestCtx)

Handle404 handles requests with no implemented handlers.

func LeaderboardGET

func LeaderboardGET(md common.MethodData) common.CodeMessager

LeaderboardGET gets the leaderboard.

func LoadAchievementsEvery

func LoadAchievementsEvery(db *sqlx.DB, d time.Duration)

LoadAchievementsEvery reloads the achievements in the database every given amount of time.

func MetaRestartGET

func MetaRestartGET(md common.MethodData) common.CodeMessager

MetaRestartGET restarts the API with Zero Downtime™.

func MetaUpSinceGET

func MetaUpSinceGET(md common.MethodData) common.CodeMessager

MetaUpSinceGET retrieves the moment the API application was started. Mainly used to get if the API was restarted.

func MetaUpdateGET

func MetaUpdateGET(md common.MethodData) common.CodeMessager

MetaUpdateGET updates the API to the latest version, and restarts it.

func PingGET

PingGET is a message to check with the API that we are logged in, and know what are our privileges.

func RAPLogPOST

func RAPLogPOST(md common.MethodData) common.CodeMessager

RAPLogPOST creates a new entry in the RAP logs

func ScoreReportPOST

func ScoreReportPOST(md common.MethodData) common.CodeMessager

ScoreReportPOST creates a new report for a score

func ScoresGET

func ScoresGET(md common.MethodData) common.CodeMessager

ScoresGET retrieves the top scores for a certain beatmap.

func SurpriseMeGET

func SurpriseMeGET(md common.MethodData) common.CodeMessager

SurpriseMeGET generates cute cats.

... Yes.

func TokenFixPrivilegesPOST

func TokenFixPrivilegesPOST(md common.MethodData) common.CodeMessager

TokenFixPrivilegesPOST fixes the privileges on the token of the given user, or of all the users if no user is given.

func TokenGET

func TokenGET(md common.MethodData) common.CodeMessager

TokenGET retrieves a list listing all the user's public tokens.

func TokenSelfDeletePOST

func TokenSelfDeletePOST(md common.MethodData) common.CodeMessager

TokenSelfDeletePOST deletes the token the user is connecting with.

func TokenSelfGET

func TokenSelfGET(md common.MethodData) common.CodeMessager

TokenSelfGET retrieves information about the token the user is connecting with.

func UserAchievementsGET

func UserAchievementsGET(md common.MethodData) common.CodeMessager

UserAchievementsGET handles requests for retrieving the achievements of a given user.

func UserEditPOST

func UserEditPOST(md common.MethodData) common.CodeMessager

UserEditPOST allows to edit an user's information.

func UserFullGET

func UserFullGET(md common.MethodData) common.CodeMessager

UserFullGET gets all of an user's information, with one exception: their userpage.

func UserLookupGET

func UserLookupGET(md common.MethodData) common.CodeMessager

UserLookupGET does a quick lookup of users beginning with the passed querystring value name.

func UserManageSetAllowedPOST

func UserManageSetAllowedPOST(md common.MethodData) common.CodeMessager

UserManageSetAllowedPOST allows to set the allowed status of an user.

func UserMostPlayedGET

func UserMostPlayedGET(md common.MethodData) common.CodeMessager

func UserScoresBestGET

func UserScoresBestGET(md common.MethodData) common.CodeMessager

UserScoresBestGET retrieves the best scores of an user, sorted by PP if mode is standard and sorted by ranked score otherwise.

func UserScoresRecentGET

func UserScoresRecentGET(md common.MethodData) common.CodeMessager

UserScoresRecentGET retrieves an user's latest scores.

func UserSelfGET

func UserSelfGET(md common.MethodData) common.CodeMessager

UserSelfGET is a shortcut for /users/id/self. (/users/self)

func UserSelfScoreboardGET

func UserSelfScoreboardGET(md common.MethodData) common.CodeMessager

UserSelfScoreboardGET returns the in-game scoreboard perferences for the current uesr

func UserSelfScoreboardPOST

func UserSelfScoreboardPOST(md common.MethodData) common.CodeMessager

UserSelfScoreboardPOST allows users to change their in-game scoreboard preferences

func UserSelfUserpagePOST

func UserSelfUserpagePOST(md common.MethodData) common.CodeMessager

UserSelfUserpagePOST allows to change the current user's userpage.

func UserUserpageGET

func UserUserpageGET(md common.MethodData) common.CodeMessager

UserUserpageGET gets an user's userpage, as in the customisable thing.

func UserWhatsTheIDGET

func UserWhatsTheIDGET(md common.MethodData) common.CodeMessager

UserWhatsTheIDGET is an API request that only returns an user's ID.

func UsersGET

func UsersGET(md common.MethodData) common.CodeMessager

UsersGET is the API handler for GET /users

func UsersSelfDonorInfoGET

func UsersSelfDonorInfoGET(md common.MethodData) common.CodeMessager

UsersSelfDonorInfoGET returns information about the users' donor status

func UsersSelfFavouriteModeGET

func UsersSelfFavouriteModeGET(md common.MethodData) common.CodeMessager

UsersSelfFavouriteModeGET gets the current user's favourite mode

func UsersSelfSettingsGET

func UsersSelfSettingsGET(md common.MethodData) common.CodeMessager

UsersSelfSettingsGET allows to get "sensitive" information about the current user.

func UsersSelfSettingsPOST

func UsersSelfSettingsPOST(md common.MethodData) common.CodeMessager

UsersSelfSettingsPOST allows to modify information about the current user.

func WipeUserPOST

func WipeUserPOST(md common.MethodData) common.CodeMessager

WipeUserPOST wipes an user's scores.

Types

type Achievement

type Achievement struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Icon        string `json:"icon"`
}

Achievement represents an achievement in the database.

type Score

type Score struct {
	ID         int                  `json:"id"`
	BeatmapMD5 string               `json:"beatmap_md5"`
	Score      int64                `json:"score"`
	MaxCombo   int                  `json:"max_combo"`
	FullCombo  bool                 `json:"full_combo"`
	Mods       int                  `json:"mods"`
	Count300   int                  `json:"count_300"`
	Count100   int                  `json:"count_100"`
	Count50    int                  `json:"count_50"`
	CountGeki  int                  `json:"count_geki"`
	CountKatu  int                  `json:"count_katu"`
	CountMiss  int                  `json:"count_miss"`
	Time       common.UnixTimestamp `json:"time"`
	PlayMode   int                  `json:"play_mode"`
	Accuracy   float64              `json:"accuracy"`
	PP         float32              `json:"pp"`
	Rank       string               `json:"rank"`
	Completed  int                  `json:"completed"`
}

Score is a score done on Ripple.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL