Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
742393c25b
|
||
|
|
e9cb1f6c45
|
||
|
|
37d08d54fa
|
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#[derive(Default)]
|
#[derive(Debug, Default)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
pub url: String,
|
pub url: String,
|
||||||
pub bucket: String,
|
pub bucket: String,
|
||||||
|
|||||||
+8
-2
@@ -2,7 +2,7 @@ pub mod config;
|
|||||||
|
|
||||||
use aws_sdk_s3::config::{Credentials, Region};
|
use aws_sdk_s3::config::{Credentials, Region};
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Debug, Default)]
|
||||||
pub struct Data {
|
pub struct Data {
|
||||||
pub filepath: String,
|
pub filepath: String,
|
||||||
pub raw_data: Vec<u8>,
|
pub raw_data: Vec<u8>,
|
||||||
@@ -42,11 +42,17 @@ impl Labyrinth {
|
|||||||
let config = aws_config::from_env()
|
let config = aws_config::from_env()
|
||||||
.region(region)
|
.region(region)
|
||||||
.credentials_provider(credentials)
|
.credentials_provider(credentials)
|
||||||
|
.endpoint_url(self.config.url.clone())
|
||||||
.load()
|
.load()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
|
let s3_config = aws_sdk_s3::config::Builder::from(&config)
|
||||||
|
.force_path_style(true) // 👈 CRITICAL for Garage/MinIO/LocalStack
|
||||||
|
.build();
|
||||||
|
|
||||||
// let config = aws_config::load_from_env().await;
|
// let config = aws_config::load_from_env().await;
|
||||||
let client = aws_sdk_s3::Client::new(&config);
|
// let client = aws_sdk_s3::Client::new(&config);
|
||||||
|
let client = aws_sdk_s3::Client::from_conf(s3_config);
|
||||||
|
|
||||||
let data_content = if data.raw_data.is_empty() {
|
let data_content = if data.raw_data.is_empty() {
|
||||||
match load_data(&data.filepath).await {
|
match load_data(&data.filepath).await {
|
||||||
|
|||||||
Reference in New Issue
Block a user