summaryrefslogtreecommitdiff
path: root/src/client.h
diff options
context:
space:
mode:
authorGravatar Anshul Gupta <ansg191@anshulg.com> 2025-06-12 01:53:38 -0700
committerGravatar GitHub <noreply@github.com> 2025-06-12 01:53:38 -0700
commitc9adb09abc626cdcc35c345a635ad8c163fcff3e (patch)
tree93f78bf8e5910a044f96ed77aca498ac60ada804 /src/client.h
parent179679633a9fc3317585167f86c87a7fe8394945 (diff)
parentb78875e2265339b58c7a67cc83e6db2988aa0d74 (diff)
downloadgithub-mirror-c9adb09abc626cdcc35c345a635ad8c163fcff3e.tar.gz
github-mirror-c9adb09abc626cdcc35c345a635ad8c163fcff3e.tar.zst
github-mirror-c9adb09abc626cdcc35c345a635ad8c163fcff3e.zip
Merge pull request #2 from ansg191/srht
Diffstat (limited to 'src/client.h')
-rw-r--r--src/client.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/client.h b/src/client.h
new file mode 100644
index 0000000..1e24f6f
--- /dev/null
+++ b/src/client.h
@@ -0,0 +1,30 @@
+//
+// Created by Anshul Gupta on 6/10/25.
+//
+
+#ifndef CLIENT_H
+#define CLIENT_H
+
+#include <cjson/cJSON.h>
+#include <curl/curl.h>
+
+#include "buffer.h"
+
+typedef void gql_client;
+
+struct gql_ctx {
+ const char *endpoint;
+ const char *token;
+ const char *user_agent;
+};
+
+gql_client *gql_client_new(struct gql_ctx ctx);
+gql_client *gql_client_dup(gql_client *client);
+void gql_client_free(gql_client *client);
+
+CURLcode gql_client_send(const gql_client *client, const char *query,
+ cJSON *args, buffer_t *buf);
+
+int gql_handle_error(const cJSON *root);
+
+#endif // CLIENT_H