Minio Storage Driver for Masonite
Project description
Project description
What is Minio-Driver?
It's an extra storage driver support for Minio in masonite 4.
Setup
Install package using pip:
pip install minio-driver
Add provider inside config/providers.py.
from minio_driver.MinioProvider import MinioProvider
PROVIDERS = [
...,
# Application Providers
MinioProvider,
]
Storage Config
Add following configuration inside config/filesystem.py after "s3": {...},
"minio": {
"driver": "minio",
"client": env("MINIO_CLIENT"),
"secret": env("MINIO_SECRET"),
"bucket": env("MINIO_BUCKET"),
"path": env("MINIO_ENDPOINT"),
},
Add following keys in .env
.
MINIO_CLIENT=
MINIO_SECRET=
MINIO_BUCKET=
MINIO_ENDPOINT=
Update the storage driver value to minio
in .env
STORAGE_DRIVER=minio
Example
from masonite.controllers import Controller
from masonite.filesystem import Storage
from masonite.request import Request
class YourController(Controller):
def your_function(self, request: Request, storage: Storage):
file = request.input('file')
path = storage.disk("minio").put_file('your_file_directory', file)
return path
Enjoy ;)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
minio_driver-0.1.3.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for minio_driver-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a37644aafd25d01eb67669c25dbb1b06e40ec25d607cbc439b4e80e02a2a09d5 |
|
MD5 | a408fec3f4cd0fd1544326e919470310 |
|
BLAKE2b-256 | 0cd94d7d95a1e56ee56a2ec98c5b20f9c391d7d7b88bc4ec50e9dd0aeb2928fa |