Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
karencfv committed Aug 29, 2024
1 parent 5ca633c commit 5888f23
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
6 changes: 4 additions & 2 deletions clickhouse-admin/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use dropshot::{HttpError, HttpResponseCreated, HttpResponseOk, RequestContext, TypedBody};
use dropshot::{
HttpError, HttpResponseCreated, HttpResponseOk, RequestContext, TypedBody,
};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use std::net::SocketAddrV6;
Expand Down Expand Up @@ -58,4 +60,4 @@ impl ServerConfigGenerateResponse {
#[serde(rename_all = "snake_case")]
pub struct ServerSettings {
pub node_id: u64,
}
}
10 changes: 6 additions & 4 deletions clickhouse-admin/src/clickward.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use camino::Utf8PathBuf;
use clickhouse_admin_api::{ClickhouseAddress, ServerConfigGenerateResponse, ServerSettings};
use clickhouse_admin_types::{ClickhouseServerConfig, ServerId};
use clickhouse_admin_api::{
ClickhouseAddress, ServerConfigGenerateResponse, ServerSettings,
};
use clickhouse_admin_types::config::{KeeperNodeConfig, ServerNodeConfig};
use clickhouse_admin_types::{ClickhouseServerConfig, ServerId};
use dropshot::HttpError;
use slog_error_chain::{InlineErrorChain, SlogInlineError};
use std::io;
use std::net::{SocketAddrV6, Ipv6Addr};
use std::net::{Ipv6Addr, SocketAddrV6};
use std::str::FromStr;

#[derive(Debug, thiserror::Error, SlogInlineError)]
Expand Down Expand Up @@ -81,7 +83,7 @@ impl Clickward {
);

config.generate_xml_file().unwrap();

Ok(ServerConfigGenerateResponse::success())
}
}
7 changes: 5 additions & 2 deletions clickhouse-admin/src/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
use crate::context::ServerContext;
use clickhouse_admin_api::*;
use dropshot::HttpError;
use dropshot::{HttpResponseOk, HttpResponseCreated, RequestContext, TypedBody};
use dropshot::{
HttpResponseCreated, HttpResponseOk, RequestContext, TypedBody,
};
use std::sync::Arc;

type ClickhouseApiDescription = dropshot::ApiDescription<Arc<ServerContext>>;
Expand All @@ -31,7 +33,8 @@ impl ClickhouseAdminApi for ClickhouseAdminImpl {
async fn generate_server_config(
rqctx: RequestContext<Self::Context>,
body: TypedBody<ServerSettings>,
) -> Result<HttpResponseCreated<ServerConfigGenerateResponse>, HttpError> {
) -> Result<HttpResponseCreated<ServerConfigGenerateResponse>, HttpError>
{
let ctx = rqctx.context();
let server_settings = body.into_inner();
let output = ctx.clickward().generate_server_config(server_settings)?;
Expand Down

0 comments on commit 5888f23

Please sign in to comment.