bool server_logout(server_t *server, token_t token)
Deletes a session, logging out an user.
void server_destroy(server_t *server)
Destroys the specified server instance.
token_t server_login(server_t *server, serial_t user_id)
Creates a new session, logging in an user.
bool server_is_admin_api_key(server_t *server, api_key_t api_key)
Checks if an API key is the admin API key.
bool server_check_admin_password(server_t *server, char const *password)
Check a password against the admin password.
server_t * server_create(api_key_t admin_api_key, char const *admin_password)
Creates a new server instance.
struct server server_t
Opaque type handle representing a server instance.
serial_t server_verify_token(server_t *server, token_t token)
Verifies a token, returning its owning user ID.
int n_requests_h
Number of requests performed since an hour.
int n_requests_m
Number of requests performed since a minute.
time_t last_request_at
Timestamp of the last request.
General types - Standalone header.
int32_t serial_t
A PosrgreSQL SERIAL primary key value starting at 1. (1..2^31-1)
int64_t token_t
A session token.