-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7913cf4
commit 225b7ff
Showing
8 changed files
with
144 additions
and
219 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use anyhow::{Context, Result}; | ||
use s3_event_bridge::{app, client}; | ||
use std::env::var; | ||
|
||
/// Run a command with files pulled from S3, uploading the results to | ||
/// S3 after it exits. | ||
#[tokio::main] | ||
async fn main() -> Result<()> { | ||
tracing_subscriber::fmt() | ||
.with_max_level(tracing::Level::INFO) | ||
.with_target(false) | ||
.without_time() | ||
.init(); | ||
app::init()?; | ||
client::init().await?; | ||
|
||
let bucket = | ||
var(&app::current().settings.bucket_var).context(&app::current().settings.bucket_var)?; | ||
let prefix = var(&app::current().settings.key_prefix_var) | ||
.context(&app::current().settings.key_prefix_var)?; | ||
let batch = app::EventBatch { bucket, prefix }; | ||
|
||
app::current() | ||
.handle(&batch, client::current()) | ||
.await | ||
.with_context(|| format!("Failed to handle batch of records {:?}", &batch))?; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pub mod app; | ||
pub mod client; | ||
mod conf; | ||
mod sign; |