chore: update nats -> async nats
This commit is contained in:
parent
b7cc1b32c0
commit
cf0e745b5b
1233
Cargo.lock
generated
1233
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -11,32 +11,32 @@ tracing-subscriber.workspace = true
|
||||
clap.workspace = true
|
||||
dotenv.workspace = true
|
||||
axum.workspace = true
|
||||
prost = "0.13.2"
|
||||
tonic = { version = "0.12.2", features = ["tls", "tls-native-roots"] }
|
||||
uuid = { version = "1.7.0", features = ["v7", "v4"] }
|
||||
async-trait = "0.1.77"
|
||||
prost = "0.13"
|
||||
tonic = { version = "0.12", features = ["tls", "tls-native-roots"] }
|
||||
uuid = { version = "1.7", features = ["v7", "v4"] }
|
||||
async-trait = "0.1"
|
||||
aws-config = { version = "1.5.5", features = ["behavior-version-latest"] }
|
||||
aws-sdk-s3 = { version = "1.48.0", features = ["behavior-version-latest"] }
|
||||
serde = { version = "1.0.196", features = ["derive"] }
|
||||
serde_json = "1.0.113"
|
||||
nats = "0.25.0"
|
||||
serde_json = "1"
|
||||
async-nats = "0.40.0"
|
||||
walkdir = "2.4.0"
|
||||
tar = "0.4.40"
|
||||
tokio-stream = { version = "0.1.15", features = ["full"] }
|
||||
rand = "0.9.0"
|
||||
rand = "0.8.5"
|
||||
sqlx = { version = "0.8.0", features = [
|
||||
"postgres",
|
||||
"runtime-tokio",
|
||||
"uuid",
|
||||
"chrono",
|
||||
] }
|
||||
chrono = "0.4.34"
|
||||
git2 = "0.20.0"
|
||||
rustls = { version = "0.23.12" }
|
||||
chrono = "0.4"
|
||||
git2 = "0.20"
|
||||
rustls = { version = "0.23" }
|
||||
|
||||
[build-dependencies]
|
||||
tonic-build = "0.12.0"
|
||||
|
||||
[dev-dependencies]
|
||||
lazy_static = "1.4.0"
|
||||
reqwest = "0.12.0"
|
||||
lazy_static = "1.4"
|
||||
reqwest = "0.12"
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::{ops::Deref, sync::Arc};
|
||||
|
||||
use sqlx::{PgPool, Postgres};
|
||||
use sqlx::PgPool;
|
||||
|
||||
use crate::services::{
|
||||
archive::Archive,
|
||||
|
@ -1,5 +1,5 @@
|
||||
use anyhow::Context;
|
||||
use sqlx::{PgPool, Postgres};
|
||||
use sqlx::PgPool;
|
||||
|
||||
pub async fn get_database() -> anyhow::Result<PgPool> {
|
||||
tracing::trace!("initializing database");
|
||||
|
@ -4,17 +4,20 @@ use anyhow::Context;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Nats {
|
||||
nats: Arc<nats::asynk::Connection>,
|
||||
nats: Arc<async_nats::Client>,
|
||||
}
|
||||
|
||||
impl Nats {
|
||||
pub async fn new() -> anyhow::Result<Self> {
|
||||
let nats = nats::asynk::Options::with_user_pass(
|
||||
&std::env::var("NATS_USERNAME").context("NATS_USERNAME was not found")?,
|
||||
&std::env::var("NATS_PASSWORD").context("NATS_PASSWORD was not found")?,
|
||||
let nats = async_nats::connect_with_options(
|
||||
std::env::var("NATS_URL").context("NATS_URL was not found")?,
|
||||
async_nats::ConnectOptions::new()
|
||||
.user_and_password(
|
||||
std::env::var("NATS_USERNAME").context("NATS_USERNAME was not found")?,
|
||||
std::env::var("NATS_PASSWORD").context("NATS_PASSWORD was not found")?,
|
||||
)
|
||||
.name(std::env!("CARGO_PKG_NAME")),
|
||||
)
|
||||
.with_name(std::env!("CARGO_PKG_NAME"))
|
||||
.connect(std::env::var("NATS_URL").context("NATS_URL was not found")?)
|
||||
.await?;
|
||||
|
||||
Ok(Self {
|
||||
@ -24,7 +27,7 @@ impl Nats {
|
||||
}
|
||||
|
||||
impl std::ops::Deref for Nats {
|
||||
type Target = nats::asynk::Connection;
|
||||
type Target = async_nats::Client;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.nats
|
||||
|
@ -1,8 +1,8 @@
|
||||
use std::{env::temp_dir, fmt::Display, net::SocketAddr};
|
||||
use std::{env::temp_dir, net::SocketAddr};
|
||||
|
||||
use tokio::io::AsyncWriteExt;
|
||||
use tokio_stream::StreamExt;
|
||||
use tonic::{service::interceptor, transport::Server};
|
||||
use tonic::transport::Server;
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::{
|
||||
|
@ -2,7 +2,7 @@
|
||||
pub struct Archive {}
|
||||
|
||||
use std::{
|
||||
io::{Bytes, Cursor},
|
||||
io::Cursor,
|
||||
path::Path,
|
||||
};
|
||||
|
||||
|
@ -15,7 +15,7 @@ impl DomainEvents {
|
||||
tracing::trace!("publish events: {}", event);
|
||||
|
||||
self.nats
|
||||
.publish("flux_releaser.domain_events", event)
|
||||
.publish("flux_releaser.domain_events", event.to_string().into())
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
|
@ -1,8 +1,7 @@
|
||||
use tonic::transport::Channel;
|
||||
|
||||
use crate::{
|
||||
app::infra::grpc::FluxReleaserGrpcClient,
|
||||
grpc::gen::{flux_releaser_client::FluxReleaserClient, UploadArtifactRequest},
|
||||
grpc::gen::UploadArtifactRequest,
|
||||
};
|
||||
|
||||
use super::{archive::ArchiveFile, release_manager::models::UploadArtifactID};
|
||||
|
@ -1,6 +1,6 @@
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::services::archive::{Archive, ArchiveFile};
|
||||
use crate::services::archive::ArchiveFile;
|
||||
use crate::services::artifacts_db::{AddCommitArtifact, GetLatestArtifact};
|
||||
use crate::services::file_store::FileStore;
|
||||
|
||||
|
@ -1,6 +1,3 @@
|
||||
use flux_releaser::services::{
|
||||
archive::Archive, file_reader::FileReader, flux_local_cluster::FluxLocalClusterManager,
|
||||
};
|
||||
|
||||
#[tokio::test]
|
||||
async fn can_package_files() -> anyhow::Result<()> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user