diff options
Diffstat (limited to 'libgs/src/client.h')
-rw-r--r-- | libgs/src/client.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libgs/src/client.h b/libgs/src/client.h new file mode 100644 index 0000000..d24b1ff --- /dev/null +++ b/libgs/src/client.h @@ -0,0 +1,29 @@ +#ifndef __GS_CLIENT_H +#define __GS_CLIENT_H + +typedef struct { + char *server; + char *client_id; + char *client_secret; + char *access_token; +} GSClient; + +/* + * Create new GSClient with server url, client_id and client_secret returned + * from gs_register call. + * It will add `http://` prefix to server if it doesn't exists. + */ +GSClient *gs_client_new(const char *server, const char *client_id, + const char *client_secret); + +/* Generic helper fuction to make http calls */ +void *gs_client_do_api(GSClient *c, int method, const char *url, + const char *req); + +/* Set user access_token */ +void gs_client_set_token(GSClient *c, const char *access_token); + +/* Free GSClient */ +void gs_client_free(GSClient *c); + +#endif |