Skip to content

Commit 6589bbc

Browse files
authored
libfaasm(s3): add option to include prefix (#130)
* libfaasm(s3): add option to include prefix * libfaasm(s3): add prefix right after bucket for get keys * libfaasm: add option to truncate when adding key bytes * nits: run clang format
1 parent f35edf5 commit 6589bbc

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

libfaasm/faasm/host_interface.h

+13-1
Original file line numberDiff line numberDiff line change
@@ -173,17 +173,29 @@ void __faasm_s3_list_buckets(void* bucketsBuffer, int* bucketsBufferLens);
173173
HOST_IFACE_FUNC
174174
int __faasm_s3_get_num_keys(const char* bucketName);
175175

176+
HOST_IFACE_FUNC
177+
int __faasm_s3_get_num_keys_with_prefix(const char* bucketName,
178+
const char* prefix);
179+
176180
// Note that keysBuffer is, in reality, a char** populated by the host
177181
HOST_IFACE_FUNC
178182
void __faasm_s3_list_keys(const char* bucketName,
179183
void* keysBuffer,
180184
int* keysBufferLens);
181185

186+
// Note that keysBuffer is, in reality, a char** populated by the host
187+
HOST_IFACE_FUNC
188+
void __faasm_s3_list_keys_with_prefix(const char* bucketName,
189+
const char* prefix,
190+
void* keysBuffer,
191+
int* keysBufferLens);
192+
182193
HOST_IFACE_FUNC
183194
int __faasm_s3_add_key_bytes(const char* bucketName,
184195
const char* keyName,
185196
void* keyBuffer,
186-
int keyBufferLen);
197+
int keyBufferLen,
198+
bool overwrite = false);
187199

188200
// Note that keyBuffer is, in reality, a uint8_t** populated by the host
189201
HOST_IFACE_FUNC

libfaasm/libfaasm.imports

+2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ __faasm_migrate_point
4646
__faasm_s3_get_num_buckets
4747
__faasm_s3_list_buckets
4848
__faasm_s3_get_num_keys
49+
__faasm_s3_get_num_keys_with_prefix
4950
__faasm_s3_list_keys
51+
__faasm_s3_list_keys_with_prefix
5052
__faasm_s3_add_key_bytes
5153
__faasm_s3_get_key_bytes
5254

0 commit comments

Comments
 (0)