Add local CAS pin metadata
This commit is contained in:
parent
99f6dee26f
commit
00471bcec0
9 changed files with 169 additions and 16 deletions
|
|
@ -179,6 +179,12 @@ pub enum CasCommand {
|
|||
Has {
|
||||
hash: String,
|
||||
},
|
||||
Pin {
|
||||
hash: String,
|
||||
},
|
||||
Unpin {
|
||||
hash: String,
|
||||
},
|
||||
List,
|
||||
}
|
||||
|
||||
|
|
@ -392,6 +398,8 @@ fn request_for_command(command: Command) -> Result<ControlRequest> {
|
|||
},
|
||||
CasCommand::Hash { path } => ControlRequest::CasHash { path },
|
||||
CasCommand::Has { hash } => ControlRequest::CasHas { hash: hash.into() },
|
||||
CasCommand::Pin { hash } => ControlRequest::CasPin { hash: hash.into() },
|
||||
CasCommand::Unpin { hash } => ControlRequest::CasUnpin { hash: hash.into() },
|
||||
CasCommand::List => ControlRequest::CasList,
|
||||
},
|
||||
Command::Kv { command } => ControlRequest::ModuleStub {
|
||||
|
|
@ -585,9 +593,13 @@ fn print_response(response: ControlResponse, json: bool) -> Result<()> {
|
|||
}
|
||||
ControlResponse::CasHash { hash } => println!("{hash}"),
|
||||
ControlResponse::CasHas { hash, present } => println!("{hash}: {present}"),
|
||||
ControlResponse::CasPinned { hash, pinned } => {
|
||||
println!("{hash}: pinned={pinned}");
|
||||
}
|
||||
ControlResponse::CasList { blobs } => {
|
||||
for blob in blobs {
|
||||
println!("{}\t{} bytes", blob.hash, blob.size_bytes);
|
||||
let pin = if blob.pinned { "pinned" } else { "unpinned" };
|
||||
println!("{}\t{} bytes\t{}", blob.hash, blob.size_bytes, pin);
|
||||
}
|
||||
}
|
||||
ControlResponse::KeychainStatus(status) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue