Skip to content

Commit 5502c86

Browse files
committed
chore: create module structure for server and peer protocols
1 parent 216b1b2 commit 5502c86

File tree

11 files changed

+178
-5
lines changed

11 files changed

+178
-5
lines changed

src/client/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
mod client;
2323
pub mod rpc;
2424
pub mod rpc_pub;
25+
pub mod pub_sub;
2526

2627
pub use client::{Client, ClientCommand, ClientDelegate, ConnectionDelegate, OnDisconnect};
2728
pub use rpc::{RpcClient, RpcDelegate};

src/client/pub_sub.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Library for building scalable privacy-preserving microservices P2P nodes
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
//
5+
// Written in 2022-2023 by
6+
// Dr. Maxim Orlovsky <[email protected]>
7+
//
8+
// Copyright 2022-2023 Cyphernet DAO, Switzerland
9+
//
10+
// Licensed under the Apache License, Version 2.0 (the "License");
11+
// you may not use this file except in compliance with the License.
12+
// You may obtain a copy of the License at
13+
//
14+
// http://www.apache.org/licenses/LICENSE-2.0
15+
//
16+
// Unless required by applicable law or agreed to in writing, software
17+
// distributed under the License is distributed on an "AS IS" BASIS,
18+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19+
// See the License for the specific language governing permissions and
20+
// limitations under the License.

src/lib.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,30 @@ extern crate amplify;
2727
extern crate log_crate as log;
2828

2929
pub mod frame;
30-
#[cfg(feature = "reactor")]
31-
pub mod tunnel;
3230

3331
mod connection;
3432
mod listener;
3533
pub mod session;
3634
mod split;
3735

38-
#[cfg(feature = "io-reactor")]
36+
#[cfg(feature = "reactor")]
3937
pub mod resource;
40-
#[cfg(feature = "io-reactor")]
38+
#[cfg(feature = "reactor")]
4139
pub mod client;
40+
#[cfg(feature = "reactor")]
41+
pub mod server;
42+
#[cfg(feature = "reactor")]
43+
pub mod peer;
4244

4345
pub const READ_BUFFER_SIZE: usize = u16::MAX as usize;
4446

4547
pub use connection::{Address, AsConnection, NetConnection, NetStream};
4648
pub use frame::{Frame, Marshaller};
4749
pub use listener::NetListener;
48-
#[cfg(feature = "io-reactor")]
50+
#[cfg(feature = "reactor")]
4951
pub use resource::{ImpossibleResource, ListenerEvent, NetAccept, NetTransport, SessionEvent};
52+
#[cfg(feature = "reactor")]
53+
pub use server::tunnel;
5054
pub use session::{NetProtocol, NetSession, NetStateMachine};
5155
pub use split::{NetReader, NetWriter, SplitIo, SplitIoError, TcpReader, TcpWriter};
5256

src/peer/mod.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Library for building scalable privacy-preserving microservices P2P nodes
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
//
5+
// Written in 2022-2023 by
6+
// Dr. Maxim Orlovsky <[email protected]>
7+
//
8+
// Copyright 2022-2023 Cyphernet DAO, Switzerland
9+
//
10+
// Licensed under the Apache License, Version 2.0 (the "License");
11+
// you may not use this file except in compliance with the License.
12+
// You may obtain a copy of the License at
13+
//
14+
// http://www.apache.org/licenses/LICENSE-2.0
15+
//
16+
// Unless required by applicable law or agreed to in writing, software
17+
// distributed under the License is distributed on an "AS IS" BASIS,
18+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19+
// See the License for the specific language governing permissions and
20+
// limitations under the License.
21+
22+
mod peer;

src/peer/peer.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Library for building scalable privacy-preserving microservices P2P nodes
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
//
5+
// Written in 2022-2023 by
6+
// Dr. Maxim Orlovsky <[email protected]>
7+
//
8+
// Copyright 2022-2023 Cyphernet DAO, Switzerland
9+
//
10+
// Licensed under the Apache License, Version 2.0 (the "License");
11+
// you may not use this file except in compliance with the License.
12+
// You may obtain a copy of the License at
13+
//
14+
// http://www.apache.org/licenses/LICENSE-2.0
15+
//
16+
// Unless required by applicable law or agreed to in writing, software
17+
// distributed under the License is distributed on an "AS IS" BASIS,
18+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19+
// See the License for the specific language governing permissions and
20+
// limitations under the License.

src/server/mod.rs

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Library for building scalable privacy-preserving microservices P2P nodes
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
//
5+
// Written in 2022-2023 by
6+
// Dr. Maxim Orlovsky <[email protected]>
7+
//
8+
// Copyright 2022-2023 Cyphernet DAO, Switzerland
9+
//
10+
// Licensed under the Apache License, Version 2.0 (the "License");
11+
// you may not use this file except in compliance with the License.
12+
// You may obtain a copy of the License at
13+
//
14+
// http://www.apache.org/licenses/LICENSE-2.0
15+
//
16+
// Unless required by applicable law or agreed to in writing, software
17+
// distributed under the License is distributed on an "AS IS" BASIS,
18+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19+
// See the License for the specific language governing permissions and
20+
// limitations under the License.
21+
22+
pub mod tunnel;
23+
mod server;
24+
pub mod rpc;
25+
pub mod pub_sub;
26+
pub mod rpc_pub;

src/server/pub_sub.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Library for building scalable privacy-preserving microservices P2P nodes
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
//
5+
// Written in 2022-2023 by
6+
// Dr. Maxim Orlovsky <[email protected]>
7+
//
8+
// Copyright 2022-2023 Cyphernet DAO, Switzerland
9+
//
10+
// Licensed under the Apache License, Version 2.0 (the "License");
11+
// you may not use this file except in compliance with the License.
12+
// You may obtain a copy of the License at
13+
//
14+
// http://www.apache.org/licenses/LICENSE-2.0
15+
//
16+
// Unless required by applicable law or agreed to in writing, software
17+
// distributed under the License is distributed on an "AS IS" BASIS,
18+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19+
// See the License for the specific language governing permissions and
20+
// limitations under the License.

src/server/rpc.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Library for building scalable privacy-preserving microservices P2P nodes
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
//
5+
// Written in 2022-2023 by
6+
// Dr. Maxim Orlovsky <[email protected]>
7+
//
8+
// Copyright 2022-2023 Cyphernet DAO, Switzerland
9+
//
10+
// Licensed under the Apache License, Version 2.0 (the "License");
11+
// you may not use this file except in compliance with the License.
12+
// You may obtain a copy of the License at
13+
//
14+
// http://www.apache.org/licenses/LICENSE-2.0
15+
//
16+
// Unless required by applicable law or agreed to in writing, software
17+
// distributed under the License is distributed on an "AS IS" BASIS,
18+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19+
// See the License for the specific language governing permissions and
20+
// limitations under the License.

src/server/rpc_pub.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Library for building scalable privacy-preserving microservices P2P nodes
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
//
5+
// Written in 2022-2023 by
6+
// Dr. Maxim Orlovsky <[email protected]>
7+
//
8+
// Copyright 2022-2023 Cyphernet DAO, Switzerland
9+
//
10+
// Licensed under the Apache License, Version 2.0 (the "License");
11+
// you may not use this file except in compliance with the License.
12+
// You may obtain a copy of the License at
13+
//
14+
// http://www.apache.org/licenses/LICENSE-2.0
15+
//
16+
// Unless required by applicable law or agreed to in writing, software
17+
// distributed under the License is distributed on an "AS IS" BASIS,
18+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19+
// See the License for the specific language governing permissions and
20+
// limitations under the License.

src/server/server.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Library for building scalable privacy-preserving microservices P2P nodes
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
//
5+
// Written in 2022-2023 by
6+
// Dr. Maxim Orlovsky <[email protected]>
7+
//
8+
// Copyright 2022-2023 Cyphernet DAO, Switzerland
9+
//
10+
// Licensed under the Apache License, Version 2.0 (the "License");
11+
// you may not use this file except in compliance with the License.
12+
// You may obtain a copy of the License at
13+
//
14+
// http://www.apache.org/licenses/LICENSE-2.0
15+
//
16+
// Unless required by applicable law or agreed to in writing, software
17+
// distributed under the License is distributed on an "AS IS" BASIS,
18+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19+
// See the License for the specific language governing permissions and
20+
// limitations under the License.

src/tunnel.rs src/server/tunnel.rs

File renamed without changes.

0 commit comments

Comments
 (0)