Class swarmauri_gitfilter_minio.minio_filter.MinioFilter
swarmauri_gitfilter_minio.minio_filter.MinioFilter
MinioFilter(
endpoint,
access_key,
secret_key,
bucket,
*,
secure=True,
prefix="",
**kwargs,
)
Bases: StorageAdapterBase
, GitFilterBase
Interact with MinIO for storing Git objects.
Provides helpers to upload and download individual files or directory trees, allowing Peagen to offload repository data to object storage.
Create a new MinioFilter instance.
endpoint (str): Host and port of the MinIO service.
access_key (SecretStr): Access key credential.
secret_key (SecretStr): Secret key credential.
bucket (str): Bucket name to store objects in.
secure (bool): Use HTTPS when True
.
prefix (str): Optional path prefix inside the bucket.
**kwargs: Additional options forwarded to StorageAdapterBase
.
RETURNS (None): This method does not return anything.
Source code in swarmauri_gitfilter_minio/minio_filter.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
root_uri
property
root_uri
Return the root URI for the configured bucket and prefix.
RETURNS (str): Base MinIO URI ending with a trailing slash.
upload
upload(key, data)
Upload a binary stream to the bucket.
key (str): Destination object key. data (BinaryIO): File-like object containing the data.
RETURNS (str): URI of the stored object. RAISES (S3Error): If the upload fails.
Source code in swarmauri_gitfilter_minio/minio_filter.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
|
download
download(key)
Retrieve an object from the bucket.
key (str): Object key to fetch.
RETURNS (BinaryIO): Buffer containing the object data. RAISES (FileNotFoundError): If the object cannot be found.
Source code in swarmauri_gitfilter_minio/minio_filter.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
|
upload_dir
upload_dir(src, *, prefix='')
Upload all files under a directory to the bucket.
src (str | os.PathLike): Local directory to walk. prefix (str): Optional key prefix to prepend to uploaded objects.
RETURNS (None): This method does not return anything.
Source code in swarmauri_gitfilter_minio/minio_filter.py
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|
iter_prefix
iter_prefix(prefix)
Iterate over object keys matching a prefix.
prefix (str): Key prefix to match.
RETURNS (Iterator[str]): Relative keys under the configured prefix.
Source code in swarmauri_gitfilter_minio/minio_filter.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
|
download_prefix
download_prefix(prefix, dest_dir)
Download all objects beneath a prefix into a directory.
prefix (str): Key prefix to copy from the bucket. dest_dir (str | os.PathLike): Local directory to populate.
RETURNS (None): This method does not return anything.
Source code in swarmauri_gitfilter_minio/minio_filter.py
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
|
from_uri
classmethod
from_uri(uri)
Create a MinioFilter from a connection string.
uri (str): A URI like minio://host:port/bucket/prefix
.
RETURNS (MinioFilter): Configured MinioFilter
instance.
Source code in swarmauri_gitfilter_minio/minio_filter.py
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
|