Skip to content

Commit

Permalink
folder support stabilized
Browse files Browse the repository at this point in the history
  • Loading branch information
chanderlud committed Dec 7, 2023
1 parent 8673831 commit 7b02fee
Show file tree
Hide file tree
Showing 9 changed files with 627 additions and 278 deletions.
7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "cccp"
version = "0.1.0"
edition = "2021"
build = "build.rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -17,6 +18,12 @@ regex = "1.10"
dirs = "5.0"
rpassword = "7.3"
indicatif = "0.17"
prost = "0.12"
prost-build = "0.12"
async-channel = "2.1"

[build-dependencies]
prost-build = "0.12.3"

[profile.release]
opt-level = 3
Expand Down
6 changes: 6 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use std::io::Result;

fn main() -> Result<()> {
prost_build::compile_protos(&["src/items.proto"], &["src/"])?;
Ok(())
}
57 changes: 0 additions & 57 deletions scratch.txt

This file was deleted.

46 changes: 46 additions & 0 deletions src/items.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
syntax = "proto3";

package cccp.items;

message Message {
oneof message {
Files files = 1;
Confirmations confirmations = 2;
StartIndex start_index = 3;
Start start = 4;
End end = 5;
Done done = 6;
}
}

message Files {
repeated string directories = 1;
map<uint32, FileDetail> files = 2; // map for file details
}

message FileDetail {
string file_path = 1;
uint64 file_size = 2;
}

message Confirmations {
map<uint32, ConfirmationIndexes> indexes = 1;
}

message ConfirmationIndexes {
repeated uint64 inner = 1;
}

message StartIndex {
uint64 index = 1;
}

message Start {
uint32 id = 1;
}

message End {
uint32 id = 1;
}

message Done {}
Loading

0 comments on commit 7b02fee

Please sign in to comment.