Refactor command to make is shorter
Compare changes
- DISSOUBRAY Nathan authored
+ 57
− 165
@@ -22,6 +24,8 @@ use crate::app::AppState;
@@ -109,7 +113,7 @@ pub(crate) enum DragoonCommand {
@@ -139,6 +143,23 @@ impl std::fmt::Display for DragoonCommand {
@@ -150,13 +171,7 @@ pub(crate) async fn listen(
@@ -167,13 +182,7 @@ pub(crate) async fn get_listeners(State(state): State<Arc<AppState>>) -> Respons
@@ -184,17 +193,11 @@ pub(crate) async fn get_peer_id(State(state): State<Arc<AppState>>) -> Response
@@ -205,6 +208,22 @@ struct SerNetworkInfo {
@@ -213,29 +232,7 @@ pub(crate) async fn get_network_info(State(state): State<Arc<AppState>>) -> Resp
@@ -252,13 +249,7 @@ pub(crate) async fn remove_listener(
@@ -269,22 +260,7 @@ pub(crate) async fn get_connected_peers(State(state): State<Arc<AppState>>) -> R
@@ -298,13 +274,7 @@ pub(crate) async fn dial(
@@ -318,13 +288,7 @@ pub(crate) async fn add_peer(
@@ -338,13 +302,7 @@ pub(crate) async fn start_provide(
@@ -353,22 +311,7 @@ pub(crate) async fn dragoon_peers(State(state): State<Arc<AppState>>) -> Respons
@@ -384,13 +327,7 @@ pub(crate) async fn dragoon_send(
@@ -406,13 +343,7 @@ pub(crate) async fn dragoon_get(
@@ -426,22 +357,7 @@ pub(crate) async fn get_providers(
@@ -452,13 +368,7 @@ pub(crate) async fn bootstrap(State(state): State<Arc<AppState>>) -> Response {
@@ -499,13 +409,7 @@ pub(crate) async fn get_file(
@@ -552,13 +456,7 @@ pub(crate) async fn put_record(
@@ -572,13 +470,7 @@ pub(crate) async fn get_record(
@@ -612,5 +504,5 @@ async fn send_command(command: DragoonCommand, state: Arc<AppState>) -> Option<R