Created
May 12, 2014 21:51
-
-
Save munro/a627faf2228eb332e583 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace js GetRinger | |
namespace go getringer | |
typedef string ObjectID | |
typedef string DateTimeTZ | |
typedef string Url | |
typedef string AccessToken | |
typedef string Email | |
struct PublicGame { | |
1: ObjectID _id, | |
2: Url image, | |
3: i32 listings | |
4: string name | |
5: string slug | |
} | |
struct PublicUser { | |
1: string username, | |
2: DateTimeTZ added, | |
3: string location, | |
4: string about, | |
5: Url avatar, | |
6: bool online | |
} | |
struct PrivateUserSettings { | |
2: ObjectID _id, | |
3: Email email, | |
} | |
enum LookingFor { | |
RINGER, | |
GROUP, | |
SCRIM | |
} | |
struct PublicListing { | |
1: string username, | |
2: string description, | |
3: string game, | |
4: LookingFor looking_for, | |
5: i32 player_count, | |
6: i32 player_want_count, | |
7: bool active, | |
8: DateTimeTZ added = "now()", | |
9: optional DateTimeTZ removed | |
} | |
/** | |
* Specific endpoint structs | |
*/ | |
struct PrivateUserLogin { | |
1: AccessToken access_token, | |
2: PublicUser user, | |
3: PrivateUserSettings user_settings, | |
4: set <PublicListing> listings, | |
} | |
struct PublicUserAndListing { | |
1: PublicUser user, | |
2: set <PublicListing> listings | |
} | |
service PublicService { | |
void ping(), | |
/** | |
* Users | |
*/ | |
PublicUserAndListing user( | |
1: string username, | |
), | |
PrivateUserLogin userLogin( | |
1: string account, | |
2: string password, | |
), | |
PrivateUserLogin userSignup( | |
1: string username, | |
2: Email email, | |
3: string password, | |
), | |
bool usernameInUse( | |
1: string username, | |
), | |
// @TODO settings get | |
// @TODO settings update | |
/** | |
* Games | |
*/ | |
set <PublicGame> games(), | |
PublicGame game( | |
1: string slug | |
), | |
/** | |
* Listings | |
*/ | |
PublicListing getListing( | |
1: i32 listing_id | |
), | |
// @TODO listing create | |
// @TODO listing remove | |
// @TODO listing list | |
/** | |
* Messages | |
*/ | |
// @TODO get user list / last messages | |
// @TODO message send | |
} | |
service ChatSendService { | |
// @TODO authorize | |
} | |
service ChatRecieveService { | |
// @TODO onMessage | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment