README.md & structure.svg

This commit is contained in:
einisto 2022-07-16 22:09:28 +03:00
parent 530e33867b
commit b8d5fb0f0b
2 changed files with 98 additions and 0 deletions

44
README.md Normal file
View File

@ -0,0 +1,44 @@
## TCP socket pair for easy and efficient file transfer
Single binary (~5.6 MB) containing both server and client. Originally made as an backend for [other project](https://github.com/einisto/leightbox).
<p align="left">
<a href="https://github.com/einisto/fragilebyte/actions/workflows/ci.yml"><img src="https://img.shields.io/github/workflow/status/einisto/fragilebyte/Cargo%20Build%20&%20Test"></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/github/license/einisto/fragilebyte"></a>
</p>
### Installation and usage
Quickly run with:
```shell
cargo run -- <OPTIONS>
```
or create and run an optimized, independent binary:
```shell
cargo build --release
./target/release/fragilebyte <OPTIONS>
```
```shell
USAGE:
fragilebyte [OPTIONS]
OPTIONS:
-b, --buffersize <BUFFERSIZE> Buffersize used in the file transfer (bytes) [default: 8192]
-f, --fileroot <FILEROOT> Path to the folder where the files are outputted as a client or
served from as a server [default: './output' / './data']
-h, --help Print help information
--localhost Run only in the local network
-p, --port <PORT> Port where the service is hosted [default: 8080]
-t, --target <TARGET> Server's address when connecting as a client
--timeout <TIMEOUT> Seconds of inactivity after which the server closes itself
[default: 30]
-V, --version Print version informatio
```
### Dependencies
![DependenciesGraph](https://github.com/einisto/fragilebyte/blob/main/doc/structure.svg)

54
doc/structure.svg Normal file
View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 4.0.0 (0)
-->
<!-- Pages: 1 -->
<svg width="338pt" height="116pt"
viewBox="0.00 0.00 337.69 116.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 112)">
<polygon fill="white" stroke="transparent" points="-4,4 -4,-112 333.69,-112 333.69,4 -4,4"/>
<!-- fragilebyte -->
<g id="node1" class="node">
<title>fragilebyte</title>
<ellipse fill="none" stroke="black" cx="160.9" cy="-90" rx="61.99" ry="18"/>
<text text-anchor="middle" x="160.9" y="-86.3" font-family="Times,serif" font-size="14.00">fragilebyte</text>
</g>
<!-- clap -->
<g id="node2" class="node">
<title>clap</title>
<ellipse fill="none" stroke="black" cx="29.9" cy="-18" rx="29.8" ry="18"/>
<text text-anchor="middle" x="29.9" y="-14.3" font-family="Times,serif" font-size="14.00">clap</text>
</g>
<!-- fragilebyte&#45;&gt;clap -->
<g id="edge1" class="edge">
<title>fragilebyte&#45;&gt;clap</title>
<path fill="none" stroke="black" d="M132.47,-73.81C111.27,-62.48 82.34,-47.02 60.61,-35.41"/>
<polygon fill="black" stroke="black" points="62.25,-32.32 51.78,-30.69 58.95,-38.49 62.25,-32.32"/>
</g>
<!-- local&#45;ip&#45;address -->
<g id="node3" class="node">
<title>local&#45;ip&#45;address</title>
<ellipse fill="none" stroke="black" cx="160.9" cy="-18" rx="83.39" ry="18"/>
<text text-anchor="middle" x="160.9" y="-14.3" font-family="Times,serif" font-size="14.00">local&#45;ip&#45;address</text>
</g>
<!-- fragilebyte&#45;&gt;local&#45;ip&#45;address -->
<g id="edge2" class="edge">
<title>fragilebyte&#45;&gt;local&#45;ip&#45;address</title>
<path fill="none" stroke="black" d="M160.9,-71.7C160.9,-63.98 160.9,-54.71 160.9,-46.11"/>
<polygon fill="black" stroke="black" points="164.4,-46.1 160.9,-36.1 157.4,-46.1 164.4,-46.1"/>
</g>
<!-- tokio -->
<g id="node4" class="node">
<title>tokio</title>
<ellipse fill="none" stroke="black" cx="295.9" cy="-18" rx="33.6" ry="18"/>
<text text-anchor="middle" x="295.9" y="-14.3" font-family="Times,serif" font-size="14.00">tokio</text>
</g>
<!-- fragilebyte&#45;&gt;tokio -->
<g id="edge3" class="edge">
<title>fragilebyte&#45;&gt;tokio</title>
<path fill="none" stroke="black" d="M189.86,-73.98C211.42,-62.81 240.86,-47.54 263.25,-35.93"/>
<polygon fill="black" stroke="black" points="265.11,-38.91 272.37,-31.2 261.89,-32.69 265.11,-38.91"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB