Apache OpenDALâ„¢ C Binding
The C binding for Apache OpenDALâ„¢
Loading...
Searching...
No Matches
opendal.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#ifndef _OPENDAL_H
21#define _OPENDAL_H
22
23#include <stdint.h>
24#include <stddef.h>
25#include <stdbool.h>
26
27#define OPENDAL_SEEK_SET 0
28
29#define OPENDAL_SEEK_CUR 1
30
31#define OPENDAL_SEEK_END 2
32
92
94
106typedef struct opendal_bytes {
110 uint8_t *data;
114 uintptr_t len;
118 uintptr_t capacity;
120
144
153typedef struct opendal_entry {
158 void *inner;
160
178
195
208
227
238
252
273
296
314
328
389
408
427
517
531
548
618
631
647
671
692
713
731
782
800
839
880
908
927
939
944typedef struct opendal_capability {
948 bool stat;
984 bool read;
1020 bool write;
1108 bool copy;
1144 bool list;
1190
1198
1212
1226
1242
1258
1274
1302
1303#ifdef __cplusplus
1304extern "C" {
1305#endif // __cplusplus
1306
1311
1322
1327
1332
1337 bool jitter,
1338 float factor,
1339 uint64_t min_delay_ns,
1340 uint64_t max_delay_ns,
1341 uint64_t max_times);
1342
1347 uint64_t timeout_ns,
1348 uint64_t io_timeout_ns);
1349
1354
1359
1363uint8_t opendal_metadata_mode(const struct opendal_metadata *self);
1364
1369
1374
1379
1386
1391
1398
1405
1412
1419
1426
1432char *opendal_metadata_etag(const struct opendal_metadata *self);
1433
1440
1447
1462
1467
1472
1477
1496
1537 const struct opendal_operator_options *options);
1538
1550 const struct opendal_operator_options *options,
1551 const struct opendal_operator_layers *layers);
1552
1600 const char *path,
1601 const struct opendal_bytes *bytes);
1602
1607 const char *path,
1608 const struct opendal_bytes *bytes,
1609 const struct opendal_write_options *opts);
1610
1644 const char *path,
1645 const struct opendal_bytes *bytes,
1646 const struct opendal_write_options *opts);
1647
1690 const char *path);
1691
1724 const char *path,
1725 const struct opendal_read_options *opts);
1726
1766 const char *path);
1767
1796 const char *path,
1797 const struct opendal_reader_options *opts);
1798
1838 const char *path);
1839
1844 const char *path,
1845 const struct opendal_write_options *opts);
1846
1889struct opendal_error *opendal_operator_delete(const struct opendal_operator *op, const char *path);
1890
1914 const char *path,
1915 const struct opendal_delete_options *opts);
1916
1957 const char *path);
1958
1999 const char *path);
2000
2040 const char *path);
2041
2067 const char *path,
2068 const struct opendal_stat_options *opts);
2069
2121 const char *path);
2122
2147 const char *path,
2148 const struct opendal_list_options *opts);
2149
2186 const char *path);
2187
2232 const char *src,
2233 const char *dest);
2234
2279 const char *src,
2280 const char *dest);
2281
2336 const char *src,
2337 const char *dest,
2338 const struct opendal_copy_options *opts);
2339
2341
2370 const char *src,
2371 const char *dest);
2372
2388 const char *src,
2389 const char *dest,
2390 const struct opendal_copy_options *opts);
2391
2411
2416
2423
2430
2438
2443
2448 const char *path,
2449 uint64_t expire_secs);
2450
2455 const char *path,
2456 uint64_t expire_secs,
2457 const struct opendal_read_options *opts);
2458
2463 const char *path,
2464 uint64_t expire_secs);
2465
2470 const char *path,
2471 uint64_t expire_secs,
2472 const struct opendal_write_options *opts);
2473
2478 const char *path,
2479 uint64_t expire_secs);
2480
2485 const char *path,
2486 uint64_t expire_secs,
2487 const struct opendal_delete_options *opts);
2488
2493 const char *path,
2494 uint64_t expire_secs);
2495
2500 const char *path,
2501 uint64_t expire_secs,
2502 const struct opendal_stat_options *opts);
2503
2508
2513
2518
2523
2528
2534void opendal_string_free(char *ptr);
2535
2540
2549
2557
2565
2575 const char *start_after);
2576
2584
2592
2599
2608
2616
2624
2631
2636
2641
2646
2651 const char *cache_control);
2652
2657 const char *content_type);
2658
2663 const char *content_disposition);
2664
2669 const char *content_encoding);
2670
2675
2680 const char *if_none_match);
2681
2686 bool if_not_exists);
2687
2692
2697
2702 const struct opendal_write_user_metadata_pair *pairs,
2703 uintptr_t len);
2704
2709
2714
2719
2724
2729 const char *if_none_match);
2730
2735 int64_t if_modified_since);
2736
2741 int64_t if_unmodified_since);
2742
2747 const char *override_content_type);
2748
2753 const char *override_cache_control);
2754
2759 const char *override_content_disposition);
2760
2765
2770
2775 uint64_t offset,
2776 uint64_t length);
2777
2782
2787
2792
2797 const char *if_none_match);
2798
2803 int64_t if_modified_since);
2804
2809 int64_t if_unmodified_since);
2810
2815
2820
2825
2834 uint64_t content_length_hint);
2835
2840 const char *override_content_type);
2841
2846 const char *override_cache_control);
2847
2852 const char *override_content_disposition);
2853
2858
2863
2868
2873
2878 const char *if_none_match);
2879
2884 int64_t if_modified_since);
2885
2890 int64_t if_unmodified_since);
2891
2900 uint64_t content_length_hint);
2901
2906 uintptr_t concurrent);
2907
2912
2917
2922
2927
2932
2937
2942
2947 const char *source_version);
2948
2954
2959
2964
2974
2995 const char *key,
2996 const char *value);
2997
3002
3010char *opendal_entry_path(const struct opendal_entry *self);
3011
3021char *opendal_entry_name(const struct opendal_entry *self);
3022
3030
3035
3040 uint8_t *buf,
3041 uintptr_t len);
3042
3047 int64_t offset,
3048 int32_t whence);
3049
3054
3059 const struct opendal_bytes *bytes);
3060
3065
3080
3085
3101
3109
3114
3115#ifdef __cplusplus
3116} // extern "C"
3117#endif // __cplusplus
3118
3119#endif /* _OPENDAL_H */
struct opendal_result_presign opendal_operator_presign_write(const struct opendal_operator *op, const char *path, uint64_t expire_secs)
Presign a write operation.
struct opendal_error * opendal_operator_write(const struct opendal_operator *op, const char *path, const struct opendal_bytes *bytes)
Blocking write raw bytes to path.
struct opendal_delete_options * opendal_delete_options_new(void)
Construct a heap-allocated opendal_delete_options with default values.
struct opendal_result_operator_copier opendal_operator_copier_with(const struct opendal_operator *op, const char *src, const char *dest, const struct opendal_copy_options *opts)
Blocking create a copier to copy a file from src to dest with options.
struct opendal_result_operator_reader opendal_operator_reader_with(const struct opendal_operator *op, const char *path, const struct opendal_reader_options *opts)
Blocking create a reader for the specified path with options.
char * opendal_operator_info_get_name(const struct opendal_operator_info *self)
Return the nul-terminated operator backend's name, could be empty if underlying backend has no namesp...
struct opendal_result_presign opendal_operator_presign_delete_with(const struct opendal_operator *op, const char *path, uint64_t expire_secs, const struct opendal_delete_options *opts)
Presign a delete operation with options.
void opendal_read_options_set_content_length_hint(struct opendal_read_options *opts, uint64_t content_length_hint)
Set the known content length of the object.
void opendal_reader_options_set_chunk(struct opendal_reader_options *opts, uintptr_t chunk)
Set chunk size.
void opendal_write_options_set_if_match(struct opendal_write_options *opts, const char *if_match)
Set If-Match.
void opendal_operator_free(const struct opendal_operator *ptr)
Free the heap-allocated operator pointed by opendal_operator.
void opendal_write_options_free(struct opendal_write_options *opts)
Free the heap memory used by opendal_write_options.
void opendal_metadata_user_metadata_free(struct opendal_metadata_user_metadata *metadata)
Free the user metadata returned by opendal_metadata_user_metadata.
void opendal_stat_options_set_if_modified_since(struct opendal_stat_options *opts, int64_t if_modified_since)
Set If-Modified-Since in milliseconds since the Unix epoch.
void opendal_stat_options_set_if_none_match(struct opendal_stat_options *opts, const char *if_none_match)
Set If-None-Match.
void opendal_read_options_set_range_from(struct opendal_read_options *opts, uint64_t offset)
Set the read range to start at offset and extend to the end of the file.
void opendal_read_options_set_if_match(struct opendal_read_options *opts, const char *if_match)
Set If-Match.
struct opendal_result_presign opendal_operator_presign_stat_with(const struct opendal_operator *op, const char *path, uint64_t expire_secs, const struct opendal_stat_options *opts)
Presign a stat operation with options.
struct opendal_result_reader_seek opendal_reader_seek(struct opendal_reader *self, int64_t offset, int32_t whence)
Seek to an offset, in bytes, in a stream.
uint8_t opendal_metadata_mode(const struct opendal_metadata *self)
Return mode of the metadata: 0 for unknown, 1 for file, and 2 for dir.
struct opendal_operator_layers * opendal_operator_layers_new(void)
Construct a heap-allocated opendal_operator_layers.
void opendal_copy_options_set_if_not_exists(struct opendal_copy_options *opts, bool if_not_exists)
Set if_not_exists.
void opendal_reader_options_set_version(struct opendal_reader_options *opts, const char *version)
Set the version of the object to read.
struct opendal_error * opendal_operator_create_dir(const struct opendal_operator *op, const char *path)
Blocking create the directory in path.
void opendal_list_options_free(struct opendal_list_options *opts)
Free the heap memory used by opendal_list_options.
char * opendal_metadata_content_md5(const struct opendal_metadata *self)
Return the content md5 of the metadata.
void opendal_copier_free(struct opendal_copier *ptr)
Free the heap memory used by the opendal_copier.
char * opendal_metadata_content_encoding(const struct opendal_metadata *self)
Return the content encoding of the metadata.
void opendal_delete_options_set_version(struct opendal_delete_options *opts, const char *version)
Set the version option.
struct opendal_result_presign opendal_operator_presign_stat(const struct opendal_operator *op, const char *path, uint64_t expire_secs)
Presign a stat operation.
uintptr_t opendal_metadata_user_metadata_len(const struct opendal_metadata_user_metadata *metadata)
Return the number of key-value pairs in the user metadata.
char * opendal_metadata_cache_control(const struct opendal_metadata *self)
Return the cache control of the metadata.
struct opendal_error * opendal_copier_abort(struct opendal_copier *self)
Abort the pending copy operation.
void opendal_copy_options_set_if_match(struct opendal_copy_options *opts, const char *if_match)
Set If-Match.
struct opendal_result_presign opendal_operator_presign_read_with(const struct opendal_operator *op, const char *path, uint64_t expire_secs, const struct opendal_read_options *opts)
Presign a read operation with options.
void opendal_stat_options_set_override_content_disposition(struct opendal_stat_options *opts, const char *override_content_disposition)
Set the override Content-Disposition.
struct opendal_result_operator_new opendal_operator_new_with_layers(const char *scheme, const struct opendal_operator_options *options, const struct opendal_operator_layers *layers)
Construct an operator based on scheme, options, and explicit layers.
struct opendal_result_reader_read opendal_reader_read(struct opendal_reader *self, uint8_t *buf, uintptr_t len)
Read data from the reader.
struct opendal_result_operator_new opendal_operator_new(const char *scheme, const struct opendal_operator_options *options)
Construct an operator based on scheme and options
struct opendal_result_stat opendal_operator_stat_with(const struct opendal_operator *op, const char *path, const struct opendal_stat_options *opts)
Blocking stat the object in path with options.
struct opendal_result_copier_next opendal_copier_next(struct opendal_copier *self)
Perform one step of the copy operation.
struct opendal_result_lister_next opendal_lister_next(struct opendal_lister *self)
Return the next object to be listed.
void opendal_delete_options_free(struct opendal_delete_options *opts)
Free the heap memory used by opendal_delete_options.
void opendal_list_options_set_recursive(struct opendal_list_options *opts, bool recursive)
Set the recursive option.
void opendal_stat_options_set_version(struct opendal_stat_options *opts, const char *version)
Set the version.
void opendal_copy_options_set_source_content_length_hint(struct opendal_copy_options *opts, uint64_t source_content_length_hint)
Set source_content_length_hint.
struct opendal_result_write opendal_writer_close_with_metadata(struct opendal_writer *ptr)
Close the writer and return the written object's metadata.
uintptr_t opendal_presigned_request_headers_len(const struct opendal_presigned_request *req)
char * opendal_operator_info_get_scheme(const struct opendal_operator_info *self)
Return the nul-terminated operator's scheme, i.e. service.
void opendal_read_options_set_version(struct opendal_read_options *opts, const char *version)
Set the version of the object to read.
struct opendal_error * opendal_operator_write_with(const struct opendal_operator *op, const char *path, const struct opendal_bytes *bytes, const struct opendal_write_options *opts)
Blocking write raw bytes to path with options.
struct opendal_error * opendal_operator_copy_with(const struct opendal_operator *op, const char *src, const char *dest, const struct opendal_copy_options *opts)
Blocking copy the object in path with options.
void opendal_error_free(struct opendal_error *ptr)
Frees the opendal_error, ok to call on NULL.
void opendal_operator_info_free(struct opendal_operator_info *ptr)
Free the heap-allocated opendal_operator_info.
char * opendal_metadata_content_disposition(const struct opendal_metadata *self)
Return the content disposition of the metadata.
struct opendal_read_options * opendal_read_options_new(void)
Construct a heap-allocated opendal_read_options with default values.
char * opendal_metadata_version(const struct opendal_metadata *self)
Return the version of the metadata.
void opendal_list_options_set_limit(struct opendal_list_options *opts, uintptr_t limit)
Set the limit option.
struct opendal_result_read opendal_operator_read_with(const struct opendal_operator *op, const char *path, const struct opendal_read_options *opts)
Blocking read the data from path with options.
char * opendal_metadata_etag(const struct opendal_metadata *self)
Return the etag of the metadata.
void opendal_read_options_set_if_none_match(struct opendal_read_options *opts, const char *if_none_match)
Set If-None-Match.
struct opendal_result_exists opendal_operator_exists(const struct opendal_operator *op, const char *path)
Check whether the path exists.
void opendal_write_options_set_content_disposition(struct opendal_write_options *opts, const char *content_disposition)
Set Content-Disposition.
void opendal_stat_options_set_if_match(struct opendal_stat_options *opts, const char *if_match)
Set If-Match.
struct opendal_error * opendal_operator_copy(const struct opendal_operator *op, const char *src, const char *dest)
Blocking copy the object in path.
void opendal_string_free(char *ptr)
Frees a heap-allocated string returned by OpenDAL C APIs.
void opendal_write_options_set_chunk(struct opendal_write_options *opts, uintptr_t chunk)
Set chunk.
opendal_code
The error code for all opendal APIs in C binding.
Definition opendal.h:38
@ OPENDAL_CONDITION_NOT_MATCH
Definition opendal.h:82
@ OPENDAL_UNSUPPORTED
Definition opendal.h:46
@ OPENDAL_NOT_FOUND
Definition opendal.h:54
@ OPENDAL_IS_A_DIRECTORY
Definition opendal.h:62
@ OPENDAL_UNEXPECTED
Definition opendal.h:42
@ OPENDAL_PERMISSION_DENIED
Definition opendal.h:58
@ OPENDAL_ALREADY_EXISTS
Definition opendal.h:70
@ OPENDAL_IS_SAME_FILE
Definition opendal.h:78
@ OPENDAL_RANGE_NOT_SATISFIED
Definition opendal.h:86
@ OPENDAL_NOT_A_DIRECTORY
Definition opendal.h:66
@ OPENDAL_CONFLICT
Definition opendal.h:90
@ OPENDAL_RATE_LIMITED
Definition opendal.h:74
@ OPENDAL_CONFIG_INVALID
Definition opendal.h:50
struct opendal_result_writer_write opendal_writer_write(struct opendal_writer *self, const struct opendal_bytes *bytes)
Write data to the writer.
void opendal_list_options_set_deleted(struct opendal_list_options *opts, bool deleted)
Set the deleted option.
struct opendal_error * opendal_writer_close(struct opendal_writer *ptr)
Close the writer and make sure all data have been stored.
void opendal_operator_layers_free(struct opendal_operator_layers *ptr)
Free the allocated memory used by opendal_operator_layers.
struct opendal_write_options * opendal_write_options_new(void)
Construct a heap-allocated opendal_write_options with default values.
void opendal_stat_options_free(struct opendal_stat_options *opts)
Free the heap memory used by opendal_stat_options.
uint8_t opendal_metadata_is_current(const struct opendal_metadata *self)
Return whether this metadata is current.
struct opendal_reader_options * opendal_reader_options_new(void)
Construct a heap-allocated opendal_reader_options with default values.
void opendal_operator_layers_add_retry(struct opendal_operator_layers *self, bool jitter, float factor, uint64_t min_delay_ns, uint64_t max_delay_ns, uint64_t max_times)
Add a retry layer.
struct opendal_result_list opendal_operator_list_with(const struct opendal_operator *op, const char *path, const struct opendal_list_options *opts)
Blocking list the objects in path with options.
void opendal_operator_layers_add_timeout(struct opendal_operator_layers *self, uint64_t timeout_ns, uint64_t io_timeout_ns)
Add a timeout layer.
struct opendal_result_presign opendal_operator_presign_delete(const struct opendal_operator *op, const char *path, uint64_t expire_secs)
Presign a delete operation.
void opendal_lister_free(struct opendal_lister *ptr)
Free the heap-allocated metadata used by opendal_lister.
const struct opendal_metadata_user_metadata_pair * opendal_metadata_user_metadata_pairs(const struct opendal_metadata_user_metadata *metadata)
Return the key-value pairs of the user metadata.
struct opendal_result_presign opendal_operator_presign_read(const struct opendal_operator *op, const char *path, uint64_t expire_secs)
Presign a read operation.
void opendal_reader_options_set_if_unmodified_since(struct opendal_reader_options *opts, int64_t if_unmodified_since)
Set If-Unmodified-Since, in Unix milliseconds.
void opendal_read_options_set_gap(struct opendal_read_options *opts, uintptr_t gap)
Set gap size.
char * opendal_entry_name(const struct opendal_entry *self)
Name of entry.
void opendal_reader_free(struct opendal_reader *ptr)
Frees the heap memory used by the opendal_reader.
void opendal_read_options_set_concurrent(struct opendal_read_options *opts, uintptr_t concurrent)
Set concurrent read operations.
void opendal_copy_options_set_source_version(struct opendal_copy_options *opts, const char *source_version)
Set source version.
void opendal_delete_options_set_recursive(struct opendal_delete_options *opts, bool recursive)
Set the recursive option.
void opendal_operator_options_free(struct opendal_operator_options *ptr)
Free the allocated memory used by [opendal_operator_options].
bool opendal_metadata_is_file(const struct opendal_metadata *self)
Return whether the path represents a file.
void opendal_read_options_set_if_modified_since(struct opendal_read_options *opts, int64_t if_modified_since)
Set If-Modified-Since, in Unix milliseconds.
struct opendal_error * opendal_operator_delete_with(const struct opendal_operator *op, const char *path, const struct opendal_delete_options *opts)
Blocking delete the object in path with options.
void opendal_reader_options_set_if_modified_since(struct opendal_reader_options *opts, int64_t if_modified_since)
Set If-Modified-Since, in Unix milliseconds.
void opendal_read_options_set_if_unmodified_since(struct opendal_read_options *opts, int64_t if_unmodified_since)
Set If-Unmodified-Since, in Unix milliseconds.
struct opendal_result_stat opendal_operator_stat(const struct opendal_operator *op, const char *path)
Stat the path, return its metadata.
void opendal_reader_options_set_content_length_hint(struct opendal_reader_options *opts, uint64_t content_length_hint)
Set the known content length of the object.
void opendal_metadata_free(struct opendal_metadata *ptr)
Free the heap-allocated metadata used by opendal_metadata.
void opendal_write_options_set_content_type(struct opendal_write_options *opts, const char *content_type)
Set Content-Type.
void opendal_stat_options_set_if_unmodified_since(struct opendal_stat_options *opts, int64_t if_unmodified_since)
Set If-Unmodified-Since in milliseconds since the Unix epoch.
void opendal_copy_options_set_concurrent(struct opendal_copy_options *opts, uintptr_t concurrent)
Set concurrent.
void opendal_write_options_set_if_not_exists(struct opendal_write_options *opts, bool if_not_exists)
Set if_not_exists.
void opendal_write_options_set_content_encoding(struct opendal_write_options *opts, const char *content_encoding)
Set Content-Encoding.
void opendal_stat_options_set_override_content_type(struct opendal_stat_options *opts, const char *override_content_type)
Set the override Content-Type.
struct opendal_copy_options * opendal_copy_options_new(void)
Construct a heap-allocated opendal_copy_options with default values.
struct opendal_error * opendal_operator_rename(const struct opendal_operator *op, const char *src, const char *dest)
Blocking rename the object in path.
void opendal_read_options_set_override_content_disposition(struct opendal_read_options *opts, const char *override_content_disposition)
Set the override Content-Disposition (presign only).
struct opendal_result_operator_copier opendal_operator_copier(const struct opendal_operator *op, const char *src, const char *dest)
Blocking create a copier to copy a file from src to dest.
void opendal_presigned_request_free(struct opendal_presigned_request *req)
Free the presigned request.
void opendal_write_options_set_user_metadata(struct opendal_write_options *opts, const struct opendal_write_user_metadata_pair *pairs, uintptr_t len)
Set user metadata.
char * opendal_operator_info_get_root(const struct opendal_operator_info *self)
Return the nul-terminated operator's working root path.
struct opendal_result_read opendal_operator_read(const struct opendal_operator *op, const char *path)
Blocking read the data from path.
void opendal_write_options_set_append(struct opendal_write_options *opts, bool append)
Set append mode.
char * opendal_metadata_content_type(const struct opendal_metadata *self)
Return the content type of the metadata.
void opendal_writer_free(struct opendal_writer *ptr)
Frees the heap memory used by the opendal_writer.
void opendal_list_options_set_versions(struct opendal_list_options *opts, bool versions)
Set the versions option.
struct opendal_error * opendal_operator_check(const struct opendal_operator *op)
const char * opendal_presigned_request_method(const struct opendal_presigned_request *req)
char * opendal_entry_path(const struct opendal_entry *self)
Path of entry.
const char * opendal_presigned_request_uri(const struct opendal_presigned_request *req)
bool opendal_metadata_is_deleted(const struct opendal_metadata *self)
Return whether this metadata is deleted.
void opendal_read_options_set_chunk(struct opendal_read_options *opts, uintptr_t chunk)
Set chunk size.
void opendal_write_options_set_cache_control(struct opendal_write_options *opts, const char *cache_control)
Set Cache-Control.
void opendal_reader_options_set_if_match(struct opendal_reader_options *opts, const char *if_match)
Set If-Match.
void opendal_write_options_set_concurrent(struct opendal_write_options *opts, uintptr_t concurrent)
Set concurrent.
struct opendal_result_operator_writer opendal_operator_writer_with(const struct opendal_operator *op, const char *path, const struct opendal_write_options *opts)
Blocking create a writer for the specified path with options.
bool opendal_metadata_is_dir(const struct opendal_metadata *self)
Return whether the path represents a directory.
uint64_t opendal_metadata_content_length(const struct opendal_metadata *self)
Return the content_length of the metadata.
struct opendal_result_operator_reader opendal_operator_reader(const struct opendal_operator *op, const char *path)
Blocking read the data from path.
void opendal_reader_options_set_concurrent(struct opendal_reader_options *opts, uintptr_t concurrent)
Set concurrent read operations.
void opendal_read_options_set_override_content_type(struct opendal_read_options *opts, const char *override_content_type)
Set the override Content-Type (presign only).
void opendal_reader_options_free(struct opendal_reader_options *opts)
Free the heap memory used by opendal_reader_options.
struct opendal_result_is_exist opendal_operator_is_exist(const struct opendal_operator *op, const char *path)
Check whether the path exists.
void opendal_copy_options_set_chunk(struct opendal_copy_options *opts, uintptr_t chunk)
Set chunk.
void opendal_reader_options_set_if_none_match(struct opendal_reader_options *opts, const char *if_none_match)
Set If-None-Match.
void opendal_copy_options_free(struct opendal_copy_options *opts)
Free the heap memory used by opendal_copy_options.
void opendal_read_options_set_range(struct opendal_read_options *opts, uint64_t offset, uint64_t length)
Set the read range offset and length.
void opendal_read_options_free(struct opendal_read_options *opts)
Free the heap memory used by opendal_read_options.
struct opendal_metadata * opendal_entry_metadata(const struct opendal_entry *self)
Return the metadata associated with this entry.
void opendal_reader_options_set_gap(struct opendal_reader_options *opts, uintptr_t gap)
Set gap size.
void opendal_write_options_set_if_none_match(struct opendal_write_options *opts, const char *if_none_match)
Set If-None-Match.
void opendal_stat_options_set_override_cache_control(struct opendal_stat_options *opts, const char *override_cache_control)
Set the override Cache-Control.
const struct opendal_http_header_pair * opendal_presigned_request_headers(const struct opendal_presigned_request *req)
struct opendal_stat_options * opendal_stat_options_new(void)
Construct a heap-allocated opendal_stat_options with default values.
struct opendal_error * opendal_operator_delete(const struct opendal_operator *op, const char *path)
Blocking delete the object in path.
void opendal_bytes_free(struct opendal_bytes *ptr)
Frees the heap memory used by the opendal_bytes.
struct opendal_result_operator_writer opendal_operator_writer(const struct opendal_operator *op, const char *path)
Blocking create a writer for the specified path.
struct opendal_list_options * opendal_list_options_new(void)
Construct a heap-allocated opendal_list_options with default values.
struct opendal_presigned_request_inner opendal_presigned_request_inner
Definition opendal.h:93
struct opendal_result_presign opendal_operator_presign_write_with(const struct opendal_operator *op, const char *path, uint64_t expire_secs, const struct opendal_write_options *opts)
Presign a write operation with options.
void opendal_operator_options_set(struct opendal_operator_options *self, const char *key, const char *value)
Set a Key-Value pair inside opendal_operator_options.
void opendal_reader_options_set_prefetch(struct opendal_reader_options *opts, uintptr_t prefetch)
Set the number of prefetched byte ranges buffered during concurrent reads.
struct opendal_operator_options * opendal_operator_options_new(void)
Construct a heap-allocated opendal_operator_options.
struct opendal_result_write opendal_operator_write_with_metadata(const struct opendal_operator *op, const char *path, const struct opendal_bytes *bytes, const struct opendal_write_options *opts)
Blocking write raw bytes to path, returning the written object's metadata.
struct opendal_capability opendal_operator_info_get_capability(const struct opendal_operator_info *self)
Return the operator's capability.
void opendal_list_options_set_start_after(struct opendal_list_options *opts, const char *start_after)
Set the start_after option.
void opendal_read_options_set_override_cache_control(struct opendal_read_options *opts, const char *override_cache_control)
Set the override Cache-Control (presign only).
struct opendal_result_list opendal_operator_list(const struct opendal_operator *op, const char *path)
Blocking list the objects in path.
void opendal_entry_free(struct opendal_entry *ptr)
Frees the heap memory used by the opendal_list_entry.
int64_t opendal_metadata_last_modified_ms(const struct opendal_metadata *self)
Return the last_modified of the metadata, in milliseconds.
struct opendal_operator_info * opendal_operator_info_new(const struct opendal_operator *op)
Get information of underlying accessor.
struct opendal_metadata_user_metadata * opendal_metadata_get_user_metadata(const struct opendal_metadata *self)
Return the user metadata of the metadata.
opendal_bytes carries raw-bytes with its length
Definition opendal.h:106
uintptr_t capacity
Definition opendal.h:118
uintptr_t len
Definition opendal.h:114
uint8_t * data
Definition opendal.h:110
Capability is used to describe what operations are supported by current Operator.
Definition opendal.h:944
bool write_can_append
Definition opendal.h:1032
bool stat_with_version
Definition opendal.h:980
bool stat_with_if_modified_since
Definition opendal.h:960
bool write_can_multi
Definition opendal.h:1024
bool write_with_user_metadata
Definition opendal.h:1064
uintptr_t copy_multi_min_size
Definition opendal.h:1136
bool write_with_if_none_match
Definition opendal.h:1056
bool list_with_start_after
Definition opendal.h:1152
bool delete_
Definition opendal.h:1096
bool create_dir
Definition opendal.h:1092
bool list_with_versions
Definition opendal.h:1160
uintptr_t write_multi_min_size
Definition opendal.h:1080
bool shared
Definition opendal.h:1188
bool stat_with_if_match
Definition opendal.h:952
bool read_with_version
Definition opendal.h:1016
bool stat_with_if_unmodified_since
Definition opendal.h:964
bool read_with_override_content_type
Definition opendal.h:1004
bool write_with_if_not_exists
Definition opendal.h:1060
bool read_with_if_unmodified_since
Definition opendal.h:1012
bool write_with_content_encoding
Definition opendal.h:1044
bool write_with_if_match
Definition opendal.h:1052
bool stat_with_override_content_disposition
Definition opendal.h:972
bool presign_stat
Definition opendal.h:1176
bool read_with_if_match
Definition opendal.h:988
bool delete_with_version
Definition opendal.h:1100
bool write
Definition opendal.h:1020
bool presign_read
Definition opendal.h:1172
bool presign_delete
Definition opendal.h:1184
bool delete_with_recursive
Definition opendal.h:1104
bool write_with_content_type
Definition opendal.h:1036
uintptr_t write_total_max_size
Definition opendal.h:1088
bool copy_with_source_version
Definition opendal.h:1120
bool presign
Definition opendal.h:1168
bool read
Definition opendal.h:984
uintptr_t copy_multi_max_size
Definition opendal.h:1130
bool rename
Definition opendal.h:1140
bool list
Definition opendal.h:1144
bool write_with_cache_control
Definition opendal.h:1048
bool stat_with_if_none_match
Definition opendal.h:956
bool list_with_deleted
Definition opendal.h:1164
uintptr_t write_multi_max_size
Definition opendal.h:1072
bool copy_with_if_not_exists
Definition opendal.h:1112
bool write_can_empty
Definition opendal.h:1028
bool copy
Definition opendal.h:1108
bool stat
Definition opendal.h:948
bool read_with_override_content_disposition
Definition opendal.h:1000
bool read_with_if_none_match
Definition opendal.h:992
bool stat_with_override_content_type
Definition opendal.h:976
bool read_with_if_modified_since
Definition opendal.h:1008
bool copy_can_multi
Definition opendal.h:1124
bool list_with_recursive
Definition opendal.h:1156
bool write_with_content_disposition
Definition opendal.h:1040
bool stat_with_override_cache_control
Definition opendal.h:968
bool copy_with_if_match
Definition opendal.h:1116
bool presign_write
Definition opendal.h:1180
bool list_with_limit
Definition opendal.h:1148
bool read_with_override_cache_control
Definition opendal.h:996
opendal_copier completes a long-running copy operation to completion in a blocking manner....
Definition opendal.h:901
void * inner
Definition opendal.h:906
The options for copy operations.
Definition opendal.h:846
uint64_t source_content_length_hint
Definition opendal.h:866
bool if_not_exists
Definition opendal.h:850
bool has_chunk
Definition opendal.h:874
const char * if_match
Definition opendal.h:854
uintptr_t chunk
Definition opendal.h:878
bool has_source_content_length_hint
Definition opendal.h:862
uintptr_t concurrent
Definition opendal.h:870
const char * source_version
Definition opendal.h:858
The options for the delete operation.
Definition opendal.h:661
char * version
Definition opendal.h:665
bool recursive
Definition opendal.h:669
opendal_list_entry is the entry under a path, which is listed from the opendal_lister
Definition opendal.h:153
void * inner
Definition opendal.h:158
The opendal error type for C binding, containing an error code and corresponding error message.
Definition opendal.h:140
struct opendal_bytes message
Definition opendal.h:142
enum opendal_code code
Definition opendal.h:141
The key-value pair for the headers of the presigned request.
Definition opendal.h:1216
const char * key
Definition opendal.h:1220
const char * value
Definition opendal.h:1224
The options for the list operation.
Definition opendal.h:817
bool recursive
Definition opendal.h:821
bool versions
Definition opendal.h:833
char * start_after
Definition opendal.h:829
bool deleted
Definition opendal.h:837
uintptr_t limit
Definition opendal.h:825
BlockingLister is designed to list entries at given path in a blocking manner.
Definition opendal.h:188
void * inner
Definition opendal.h:193
A user metadata key-value pair.
Definition opendal.h:242
const char * key
Definition opendal.h:246
const char * value
Definition opendal.h:250
User metadata associated with a path.
Definition opendal.h:231
void * inner
Definition opendal.h:236
Carries all metadata associated with a path.
Definition opendal.h:220
void * inner
Definition opendal.h:225
Metadata for operator, users can use this metadata to get information of operator.
Definition opendal.h:932
void * inner
Definition opendal.h:937
The layers to apply when initializing an opendal_operator.
Definition opendal.h:201
void * inner
Definition opendal.h:206
The configuration for the initialization of opendal_operator.
Definition opendal.h:307
void * inner
Definition opendal.h:312
Used to access almost all OpenDAL APIs. It represents an operator that provides the unified interface...
Definition opendal.h:266
void * inner
Definition opendal.h:271
The underlying presigned request, which contains the HTTP method, URI, and headers....
Definition opendal.h:1195
struct opendal_presigned_request_inner * inner
Definition opendal.h:1196
The options for read operations.
Definition opendal.h:434
uint64_t length
Definition opendal.h:446
const char * if_match
Definition opendal.h:454
const char * override_content_type
Definition opendal.h:507
uintptr_t gap
Definition opendal.h:494
uintptr_t chunk
Definition opendal.h:486
const char * override_content_disposition
Definition opendal.h:515
int64_t if_modified_since
Definition opendal.h:466
bool has_if_unmodified_since
Definition opendal.h:470
bool has_if_modified_since
Definition opendal.h:462
bool has_content_length_hint
Definition opendal.h:498
const char * version
Definition opendal.h:450
const char * override_cache_control
Definition opendal.h:511
bool has_length
Definition opendal.h:442
int64_t if_unmodified_since
Definition opendal.h:474
bool has_chunk
Definition opendal.h:482
const char * if_none_match
Definition opendal.h:458
bool has_gap
Definition opendal.h:490
uint64_t content_length_hint
Definition opendal.h:503
uint64_t offset
Definition opendal.h:438
uintptr_t concurrent
Definition opendal.h:478
The options for creating a reader via opendal_operator_reader_with.
Definition opendal.h:555
bool has_if_modified_since
Definition opendal.h:571
bool has_if_unmodified_since
Definition opendal.h:579
int64_t if_unmodified_since
Definition opendal.h:583
bool has_gap
Definition opendal.h:608
const char * if_match
Definition opendal.h:563
uintptr_t chunk
Definition opendal.h:604
bool has_chunk
Definition opendal.h:600
uintptr_t gap
Definition opendal.h:612
const char * version
Definition opendal.h:559
uintptr_t prefetch
Definition opendal.h:616
uint64_t content_length_hint
Definition opendal.h:592
bool has_content_length_hint
Definition opendal.h:587
const char * if_none_match
Definition opendal.h:567
uintptr_t concurrent
Definition opendal.h:596
int64_t if_modified_since
Definition opendal.h:575
The result type returned by opendal's reader operation.
Definition opendal.h:524
void * inner
Definition opendal.h:529
The result type returned by opendal_copier_next().
Definition opendal.h:1288
struct opendal_error * error
Definition opendal.h:1300
bool has_next
Definition opendal.h:1296
uintptr_t size
Definition opendal.h:1292
The result type returned by opendal_operator_exists().
Definition opendal.h:703
bool exists
Definition opendal.h:707
struct opendal_error * error
Definition opendal.h:711
The result type returned by opendal_operator_is_exist().
Definition opendal.h:682
struct opendal_error * error
Definition opendal.h:690
bool is_exist
Definition opendal.h:686
The result type returned by opendal_operator_list().
Definition opendal.h:790
struct opendal_lister * lister
Definition opendal.h:794
struct opendal_error * error
Definition opendal.h:798
The result type returned by opendal_lister_next(). The list entry is the list result of the list oper...
Definition opendal.h:168
struct opendal_entry * entry
Definition opendal.h:172
struct opendal_error * error
Definition opendal.h:176
The result type returned by opendal_operator_copier().
Definition opendal.h:917
struct opendal_copier * copier
Definition opendal.h:921
struct opendal_error * error
Definition opendal.h:925
The result type returned by opendal_operator_new() operation.
Definition opendal.h:286
struct opendal_operator * op
Definition opendal.h:290
struct opendal_error * error
Definition opendal.h:294
The result type returned by opendal_operator_reader(). The result type for opendal_operator_reader(),...
Definition opendal.h:538
struct opendal_error * error
Definition opendal.h:546
struct opendal_reader * reader
Definition opendal.h:542
The result type returned by opendal_operator_writer(). The result type for opendal_operator_writer(),...
Definition opendal.h:637
struct opendal_writer * writer
Definition opendal.h:641
struct opendal_error * error
Definition opendal.h:645
The result of a presign operation.
Definition opendal.h:1202
struct opendal_presigned_request * req
Definition opendal.h:1206
struct opendal_error * error
Definition opendal.h:1210
The result type returned by opendal's read operation.
Definition opendal.h:417
struct opendal_bytes data
Definition opendal.h:421
struct opendal_error * error
Definition opendal.h:425
The is the result type returned by opendal_reader_read(). The result type contains a size field,...
Definition opendal.h:1232
struct opendal_error * error
Definition opendal.h:1240
uintptr_t size
Definition opendal.h:1236
The result type returned by opendal_reader_seek(). The result type contains a pos field,...
Definition opendal.h:1248
struct opendal_error * error
Definition opendal.h:1256
uint64_t pos
Definition opendal.h:1252
The result type returned by opendal_operator_stat().
Definition opendal.h:721
struct opendal_metadata * meta
Definition opendal.h:725
struct opendal_error * error
Definition opendal.h:729
The result type returned by the metadata-returning write operations.
Definition opendal.h:398
struct opendal_metadata * meta
Definition opendal.h:402
struct opendal_error * error
Definition opendal.h:406
The result type returned by opendal_writer_write(). The result type contains a size field,...
Definition opendal.h:1264
uintptr_t size
Definition opendal.h:1268
struct opendal_error * error
Definition opendal.h:1272
The options for stat operations.
Definition opendal.h:740
const char * override_content_type
Definition opendal.h:772
const char * if_match
Definition opendal.h:748
const char * version
Definition opendal.h:744
bool has_if_unmodified_since
Definition opendal.h:764
int64_t if_unmodified_since
Definition opendal.h:768
const char * if_none_match
Definition opendal.h:752
const char * override_cache_control
Definition opendal.h:776
bool has_if_modified_since
Definition opendal.h:756
int64_t if_modified_since
Definition opendal.h:760
const char * override_content_disposition
Definition opendal.h:780
The options for write operations.
Definition opendal.h:335
bool has_chunk
Definition opendal.h:375
const char * if_none_match
Definition opendal.h:363
const char * content_type
Definition opendal.h:347
const char * content_disposition
Definition opendal.h:351
uintptr_t chunk
Definition opendal.h:379
const struct opendal_write_user_metadata_pair * user_metadata
Definition opendal.h:383
const char * cache_control
Definition opendal.h:343
bool if_not_exists
Definition opendal.h:367
bool append
Definition opendal.h:339
uintptr_t user_metadata_len
Definition opendal.h:387
uintptr_t concurrent
Definition opendal.h:371
const char * if_match
Definition opendal.h:359
const char * content_encoding
Definition opendal.h:355
A key-value pair for write user metadata.
Definition opendal.h:318
const char * value
Definition opendal.h:326
const char * key
Definition opendal.h:322
The result type returned by opendal's writer operation.
Definition opendal.h:624
void * inner
Definition opendal.h:629