aboutsummaryrefslogtreecommitdiff
path: root/s3_worker.h
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2025-09-13 20:53:56 +0800
committerMistivia <i@mistivia.com>2025-09-13 20:53:56 +0800
commita4daf467f871b0e77f07f1071b47b960da7bfba9 (patch)
tree43b8847b395a90f5aadb57593c0d84e2c13cca7c /s3_worker.h
parentf3eeea1d7092f3ca98836035bf75b941d14c2067 (diff)
add s3 client
Diffstat (limited to 's3_worker.h')
-rw-r--r--s3_worker.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/s3_worker.h b/s3_worker.h
new file mode 100644
index 0000000..7d3d209
--- /dev/null
+++ b/s3_worker.h
@@ -0,0 +1,46 @@
+#ifndef S3_WORKER_H_
+#define S3_WORKER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void *s3client;
+
+typedef enum {
+ kUploadTask,
+ kDeleteTask,
+ kClearTask,
+} S3TaskType;
+
+typedef struct {
+ S3TaskType task_type;
+ char *local_file;
+ char *remote_name;
+} S3Task;
+
+S3Task s3_upload_task(const char *local, const char *remote);
+
+S3Task s3_delete_task(const char *name);
+
+S3Task s3_clear_task();
+
+void exec_s3_task(void *);
+
+void s3_worker_init();
+
+void* s3_worker_main(void *);
+
+void s3_worker_push(S3Task task);
+
+void s3client_init();
+
+void s3client_put(const char *filename, const char *object_name);
+
+void s3client_delete(const char *object_name);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif