package
0.0.0-20201221011027-e35b75b17896
Repository: https://github.com/kawata-wip/api.git
Documentation: pkg.go.dev

# Functions

Err for peppy API calls.
GenericError is just an error.
GetConf returns the cachedConf.
In picks x if y < x, picks z if y > z, or if none of the previous conditions is satisfies, it simply picks y.
InString takes y as a string, also allows for a default value should y be invalid as a number.
Int converts s to an int.
Load creates a new Conf, using the data in the file "api.conf".
OAuthPrivileges returns the equivalent in Privileges of a space-separated list of scopes.
Paginate creates an additional SQL LIMIT clause for paginating.
RandomString generates a random string.
SafeUsername makes a string lowercase and replaces all spaces with underscores.
SanitiseString removes all control codes from a string.
SimpleResponse returns the most basic response.
Sort allows the request to modify how the query is sorted.
Where is the same as WhereClause.Where, but creates a new WhereClause.
WSErr is the error function for errors happening in the websockets.

# Constants

user/admin privileges.
user/admin privileges.
user/admin privileges.
user/admin privileges.
user/admin privileges.
user/admin privileges.
user/admin privileges.
user/admin privileges.
user/admin privileges.
user/admin privileges.
user/admin privileges.
user/admin privileges.
user/admin privileges.
user/admin privileges.
user/admin privileges.
user/admin privileges.
user/admin privileges.
user/admin privileges.
These are the flags an user can have.
These are the flags an user can have.
can do /meta API calls.
can log in to bancho and use the chat through the delta ws api.
rank/unrank beatmaps.
can add, remove, upgrade/downgrade, make public beta keys.
can do pretty much anything to the blog, and the documentation.
admin permission to manage user permission, not only self permissions.
can change various users' badges.
translates as admin, as they can basically assign roles to anyone, even themselves.
maintainance, set registrations, global alerts, bancho settings.
can change user email, allowed status, userpage, rank, username...
used to be to fetch public data, such as user information etc.
(eventual) private messages, reports..
can see user email, and perhaps warnings in the future, basically.
change user information, write into confidential stuff...
user/admin privileges.
user/admin privileges.
user/admin privileges.
user/admin privileges.
user/admin privileges.

# Variables

GitHash is the git hash of the application.
RavenClient is the raven client to which report errors happening.
Version is the version of the API.

# Structs

Conf is the configuration file data for the ripple API.
MethodData is a struct containing the data passed over to an API method.
ResponseBase is the data that is always returned with an API request.
SortConfiguration is the configuration of Sort.
Token is an API token.
UpdateQuery is simply an SQL update query, that can be built upon passed parameters.
WhereClause is a struct representing a where clause.

# Interfaces

CodeMessager is something that has the Code() and Message() methods.

# Type aliases

Privileges is a bitwise enum of the privileges of an user's API key.
UnixTimestamp is simply a time.Time, but can be used to convert an unix timestamp in the database into a native time.Time.
UserPrivileges represents a bitwise enum of the privileges of an user.