summaryrefslogtreecommitdiff
path: root/libgs/src/client.h
diff options
context:
space:
mode:
authornirav <nirav@teisuu.com>2019-03-28 09:10:52 +0530
committernirav <nirav@teisuu.com>2019-03-28 09:10:52 +0530
commit477e1ba2977435ae7bb75c7dbd95cf28247f89bd (patch)
treece1f9719a7d11bbd47e9adea26dd610bc087962e /libgs/src/client.h
parentcc727e972f7fdc871ee1f42cf014151b67422bf0 (diff)
downloadap_client-477e1ba2977435ae7bb75c7dbd95cf28247f89bd.tar.gz
ap_client-477e1ba2977435ae7bb75c7dbd95cf28247f89bd.zip
Move APIs into libgs dirHEADmaster
Diffstat (limited to 'libgs/src/client.h')
-rw-r--r--libgs/src/client.h29
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