Compare commits
1 Commits
v0.5.0
...
1b4498c5de
Author | SHA1 | Date | |
---|---|---|---|
|
1b4498c5de |
@@ -6,13 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
## [0.5.0] - 2024-12-15
|
## [0.4.1] - 2024-12-07
|
||||||
|
|
||||||
### Added
|
|
||||||
- allow taking a local path
|
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- *(deps)* update rust crate serde to v1.0.216
|
|
||||||
- *(deps)* update rust crate prost to v0.13.4
|
- *(deps)* update rust crate prost to v0.13.4
|
||||||
|
|
||||||
### Other
|
### Other
|
||||||
|
8
Cargo.lock
generated
8
Cargo.lock
generated
@@ -1961,18 +1961,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.216"
|
version = "1.0.215"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e"
|
checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.216"
|
version = "1.0.215"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e"
|
checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
@@ -26,4 +26,4 @@ hex = { version = "0.4.3" }
|
|||||||
toml = { version = "0.8.14" }
|
toml = { version = "0.8.14" }
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.5.0"
|
version = "0.4.1"
|
||||||
|
@@ -1,5 +1,3 @@
|
|||||||
use std::path::PathBuf;
|
|
||||||
|
|
||||||
use tonic::transport::{Channel, ClientTlsConfig};
|
use tonic::transport::{Channel, ClientTlsConfig};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@@ -16,18 +14,15 @@ pub struct State {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub enum Backend {
|
pub enum Backend {
|
||||||
Local { path_override: Option<PathBuf> },
|
Local,
|
||||||
Remote { url: String },
|
Remote { url: String },
|
||||||
}
|
}
|
||||||
|
|
||||||
impl State {
|
impl State {
|
||||||
pub async fn new(backend: Backend) -> anyhow::Result<Self> {
|
pub async fn new(backend: Backend) -> anyhow::Result<Self> {
|
||||||
let (querier, commander) = match &backend {
|
let (querier, commander) = match &backend {
|
||||||
Backend::Local { path_override } => {
|
Backend::Local => {
|
||||||
let mut storage = Storage::new();
|
let storage = Storage::new();
|
||||||
if let Some(path_override) = path_override {
|
|
||||||
storage.with_base(path_override);
|
|
||||||
}
|
|
||||||
let engine = storage.load()?;
|
let engine = storage.load()?;
|
||||||
let events = Events::default();
|
let events = Events::default();
|
||||||
let engine = SharedEngine::from(engine);
|
let engine = SharedEngine::from(engine);
|
||||||
@@ -58,21 +53,15 @@ impl State {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn unlock(&self) {
|
pub fn unlock(&self) {
|
||||||
if let Backend::Local { path_override } = &self.backend {
|
if let Backend::Local = &self.backend {
|
||||||
let mut storage = Storage::new();
|
let storage = Storage::new();
|
||||||
if let Some(path_override) = path_override {
|
|
||||||
storage.with_base(path_override);
|
|
||||||
}
|
|
||||||
storage.clear_lock_file();
|
storage.clear_lock_file();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn info(&self) -> Option<anyhow::Result<String>> {
|
pub fn info(&self) -> Option<anyhow::Result<String>> {
|
||||||
if let Backend::Local { path_override } = &self.backend {
|
if let Backend::Local = &self.backend {
|
||||||
let mut storage = Storage::new();
|
let storage = Storage::new();
|
||||||
if let Some(path_override) = path_override {
|
|
||||||
storage.with_base(path_override);
|
|
||||||
}
|
|
||||||
return Some(storage.info());
|
return Some(storage.info());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,5 +1,3 @@
|
|||||||
use std::path::PathBuf;
|
|
||||||
|
|
||||||
use clap::{Parser, Subcommand, ValueEnum};
|
use clap::{Parser, Subcommand, ValueEnum};
|
||||||
use hyperlog_tui::{
|
use hyperlog_tui::{
|
||||||
commander,
|
commander,
|
||||||
@@ -17,9 +15,6 @@ struct Command {
|
|||||||
|
|
||||||
#[arg(long = "backend-url", required_if_eq("backend", "remote"))]
|
#[arg(long = "backend-url", required_if_eq("backend", "remote"))]
|
||||||
backend_url: Option<String>,
|
backend_url: Option<String>,
|
||||||
|
|
||||||
#[arg(long = "local-path")]
|
|
||||||
local_path: Option<PathBuf>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(ValueEnum, Clone)]
|
#[derive(ValueEnum, Clone)]
|
||||||
@@ -95,9 +90,7 @@ pub async fn execute() -> anyhow::Result<()> {
|
|||||||
let backend_url = cli.backend_url;
|
let backend_url = cli.backend_url;
|
||||||
|
|
||||||
let backend = match backend {
|
let backend = match backend {
|
||||||
BackendArg::Local => Backend::Local {
|
BackendArg::Local => Backend::Local,
|
||||||
path_override: cli.local_path.clone(),
|
|
||||||
},
|
|
||||||
BackendArg::Remote => Backend::Remote {
|
BackendArg::Remote => Backend::Remote {
|
||||||
url: backend_url.expect("backend-url to be set"),
|
url: backend_url.expect("backend-url to be set"),
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user