File size: 1,503 Bytes
2abfccb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from libcpp.string cimport string
from libcpp.list cimport list
from libcpp.pair cimport pair
from libcpp.vector cimport vector


cdef extern from "s3client.h":
    cdef cppclass S3Client:
        S3Client(
            const string &ak,
            const string &sk,
            const string &endpoint,
            bint verify_ssl,
            bint enable_https,
            bint use_dual_stack,
            int threads_num,
        ) except +

        int get_object(const string &bucket, const string &key, int &error_type, string &error_message, string &result, string &range) nogil
        int multipart_download_concurrency(const string &bucket, const string &key, const string &filename, int &error_type, string &error_message) nogil
        int put_object(const string &bucket, const string &key, const string &data, int &error_type, string &error_message) nogil
        int multipart_upload_concurrency(const string &bucket, const string &key, const string &filename, int &error_type, string &error_message) nogil
        int delete_obj(const string &bucket, const string &key, int error_type, const string &error_message) nogil
        int contains(const string &bucket, const string &key, int error_type, const string &error_message) nogil
        vector[string] list(const string &bucket, const string &key, int error_type, const string &error_message) nogil



    cdef void init_api(const string &bucket)

    cdef void shutdown_api()
    
    cdef list[pair[int, string]] get_error_list()