core: add md files howto layout
This commit is contained in:
		
							parent
							
								
									a6dbf561e8
								
							
						
					
					
						commit
						418233c48d
					
				
							
								
								
									
										68
									
								
								howto.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								howto.md
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,68 @@
 | 
			
		||||
 | 
			
		||||
# Backend internal interview (rust) - improved
 | 
			
		||||
 | 
			
		||||
## How to used
 | 
			
		||||
 | 
			
		||||
**cargo run --** can be replaced for generated binaries with
 | 
			
		||||
 
 | 
			
		||||
- target/debug/be-technical-interview-rust (for debug build)
 | 
			
		||||
- target/release/be-technical-interview-rust (for release build)
 | 
			
		||||
 | 
			
		||||
### For help
 | 
			
		||||
 | 
			
		||||
```bash
 | 
			
		||||
cargo run -- -h
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### For input file **input.txt**
 | 
			
		||||
 | 
			
		||||
```bash
 | 
			
		||||
cargo run -- -i input.txt
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### In quiet mode
 | 
			
		||||
 | 
			
		||||
```bash
 | 
			
		||||
cargo run -- -i input.txt -q
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
if **output path** is provided, results will be saved in provided path,<br>
 | 
			
		||||
without **quiet mode** info is printed to terminal
 | 
			
		||||
 | 
			
		||||
```bash
 | 
			
		||||
cargo run -- -i input.txt -o /tmp/output.txt
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### Use config path. **Batch processing in parallel** (one thread for each target) 
 | 
			
		||||
 | 
			
		||||
```bash
 | 
			
		||||
cargo run -- -c config.toml
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### Config file content
 | 
			
		||||
 | 
			
		||||
```toml
 | 
			
		||||
be_quiet = false
 | 
			
		||||
[[targets]]
 | 
			
		||||
input = "input.txt"
 | 
			
		||||
 | 
			
		||||
[[targets]]
 | 
			
		||||
input = "input_2.txt"
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
If **output** path is provided, **out_overwrite** can be used (true or false) to append conten or rewrite.
 | 
			
		||||
 | 
			
		||||
By default:
 | 
			
		||||
 | 
			
		||||
- **out_overwrite** is **true**
 | 
			
		||||
- *reg_exp** is set as
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
pub const DEFAULT_REG_EXP: &str = r"(\d+) (\w+) (\d+)";
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
**reg_exp** can be provided but as a **regex** expresion from **string**, if it can not be converted parser exit.
 | 
			
		||||
 | 
			
		||||
> [!CAUTION]
 | 
			
		||||
> Command line options have precedence over **config path** settings. <br>
 | 
			
		||||
> Be careful with the combinations
 | 
			
		||||
							
								
								
									
										38
									
								
								layout.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								layout.md
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,38 @@
 | 
			
		||||
 | 
			
		||||
# Backend internal interview (rust) - improved  
 | 
			
		||||
 | 
			
		||||
Files layout 
 | 
			
		||||
 | 
			
		||||
```markdown
 | 
			
		||||
.
 | 
			
		||||
├── ABOUT.md           [Verification](ABOUT.md)
 | 
			
		||||
├── Cargo.lock
 | 
			
		||||
├── Cargo.toml
 | 
			
		||||
├── CHANGES.md         [Changes](CHANGES.md)
 | 
			
		||||
├── Home-Task_exercise_interview_Rust.pdf
 | 
			
		||||
├── LICENSE
 | 
			
		||||
├── README.md 
 | 
			
		||||
├── assets             [Assets files for rustdoc](assets)
 | 
			
		||||
│   ├── doc.css
 | 
			
		||||
│   ├── header.html
 | 
			
		||||
│   └── howto.md
 | 
			
		||||
├── howto.md           [How to use](howto.md)
 | 
			
		||||
├── input.txt
 | 
			
		||||
├── input_2.txt        [Second input for parallel](input2.txt)
 | 
			
		||||
├── layout.md          [Files layout](layout.md)
 | 
			
		||||
├── output_expected.txt
 | 
			
		||||
└── src                [source code](src)
 | 
			
		||||
   ├── defs     
 | 
			
		||||
   │   ├── cli.rs
 | 
			
		||||
   │   ├── config.rs
 | 
			
		||||
   │   ├── metric_data.rs
 | 
			
		||||
   │   └── metrics.rs
 | 
			
		||||
   ├── defs.rs
 | 
			
		||||
   ├── main.rs
 | 
			
		||||
   ├── metrics_consumer.rs
 | 
			
		||||
   └── tests.rs
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
**.cargo** for **rustdoc** documentation build.
 | 
			
		||||
**.gitignore** to exclude paths like **target**
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user