mirror of https://github.com/chipsenkbeil/distant
Initial commit
parent
40c265e35b
commit
505b3a83e8
@ -0,0 +1,36 @@
|
||||
[package]
|
||||
name = "distant-local"
|
||||
description = "Library implementing distant API for local interactions"
|
||||
categories = ["network-programming"]
|
||||
version = "0.20.0-alpha.7"
|
||||
authors = ["Chip Senkbeil <chip@senkbeil.org>"]
|
||||
edition = "2021"
|
||||
homepage = "https://github.com/chipsenkbeil/distant"
|
||||
repository = "https://github.com/chipsenkbeil/distant"
|
||||
readme = "README.md"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1.68"
|
||||
distant-core = { version = "=0.20.0-alpha.7", path = "../distant-core" }
|
||||
grep = "0.2.11"
|
||||
ignore = "0.4.20"
|
||||
log = "0.4.17"
|
||||
notify = { version = "6.0.0", features = ["serde"] }
|
||||
num_cpus = "1.15.0"
|
||||
portable-pty = "0.8.1"
|
||||
rand = { version = "0.8.5", features = ["getrandom"] }
|
||||
shell-words = "1.1.0"
|
||||
tokio = { version = "1.27.0", features = ["full"] }
|
||||
walkdir = "2.3.3"
|
||||
whoami = "1.4.0"
|
||||
winsplit = "0.1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
assert_fs = "1.0.12"
|
||||
env_logger = "0.10.0"
|
||||
indoc = "2.0.1"
|
||||
once_cell = "1.17.1"
|
||||
predicates = "3.0.2"
|
||||
rstest = "0.17.0"
|
||||
test-log = "0.2.11"
|
@ -0,0 +1,14 @@
|
||||
use std::time::Duration;
|
||||
|
||||
/// Capacity associated with the server's file watcher to pass events outbound
|
||||
pub const SERVER_WATCHER_CAPACITY: usize = 10000;
|
||||
|
||||
/// Represents the maximum size (in bytes) that data will be read from pipes
|
||||
/// per individual `read` call
|
||||
///
|
||||
/// Current setting is 16k size
|
||||
pub const MAX_PIPE_CHUNK_SIZE: usize = 16384;
|
||||
|
||||
/// Duration in milliseconds to sleep between reading stdout/stderr chunks
|
||||
/// to avoid sending many small messages to clients
|
||||
pub const READ_PAUSE_DURATION: Duration = Duration::from_millis(1);
|
@ -0,0 +1,17 @@
|
||||
mod api;
|
||||
mod constants;
|
||||
pub use api::LocalDistantApi;
|
||||
|
||||
use distant_core::{DistantApi, DistantApiServerHandler};
|
||||
|
||||
/// Implementation of [`DistantApiServerHandler`] using [`LocalDistantApi`].
|
||||
pub type LocalDistantApiServerHandler =
|
||||
DistantApiServerHandler<LocalDistantApi, <LocalDistantApi as DistantApi>::LocalData>;
|
||||
|
||||
/// Initializes a new [`LocalDistantApiServerHandler`].
|
||||
pub fn initialize_handler() -> std::io::Result<LocalDistantApiServerHandler> {
|
||||
Ok(LocalDistantApiServerHandler::new(
|
||||
LocalDistantApi::initialize()?,
|
||||
))
|
||||
}
|
||||
|
Loading…
Reference in New Issue