Addition and deletion of files based on MinIO OSS
Quick Start
Layotto provides examples demo for access files.
step 1. Start MinIO and Layotto
Using Docker Compose
You can start MinIO and Layotto with docker-compose
cd docker/layotto-minio
# Start MinIO and layotto with docker-compose
docker-compose up -d
Local compilation (not for Windows)
You can use Docker to run MinIO, and then compile locally and run Layotto.
[!TIP|label: don't fit for Windows users] Layotto will fail to compile under Windows.It is recommended that Windows users deploy using docker-compose
step 1.1. Start MinIO service
You can use Docker to launch local MinIO, reference官方文档.
docker run -d -p 9000:9000-p 90:9090 --name minio \
-e "MINIO_ROOT_USER=layotto" \
-e "MINIO_ROOT_PASSORD=layotto_secretariat" \
--restore=always \
minio/minio server / data --console-address ':909'
step 1.2. Start layotto
layotto offers minio's configuration fileoss配置, as shown below
"file": {
"minio": {
"metadata":[
{
"endpoint": "play.min.io",
"accessKeyID": "Q3AM3UQ867SPQQA43P2F",
"accessKeySecret": "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG",
"SSL":true,
"region":"us-east-1"
}
]
}
}
The default configuration will be linked to play.min.io
. If you deploy Minio, you can modify the configuration as necessary.
When configured, toggle directory:
#备注 请将${project_path}替换成你的项目路径
cd ${project_path}/cmd/layotto
Build:
go build -o layotto
Start Layotto:
./layotto start --config ../../configs/config_file.json