files
This module is concerned with functions and objects related to file handling.
get_minio_client
get_minio_client(host: str = 'minio') -> Minio
get_minio_client creates and returns a client that can connect with the minIO
Parameters:
Name | Type | Description | Default |
---|---|---|---|
host |
str
|
host to connect client to, by default "minio" |
'minio'
|
Returns:
Type | Description |
---|---|
Minio
|
client to interact with minIO service |
Source code in api/core/files.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
get_file_size
async
get_file_size(file: UploadFile) -> int
get_file_size calculates the size of an uploaded file.
This is required as the minIO client put_object method requires the length of the object being uploaded as one of the parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file |
UploadFile
|
file of supported file type that user uploads |
required |
Returns:
Type | Description |
---|---|
int
|
size of the uploaded file |
Source code in api/core/files.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|