Compare commits
5 Commits
4c48258b05
...
v0.5.0
Author | SHA1 | Date | |
---|---|---|---|
6a179f0881 | |||
09546907e5
|
|||
83f9816cce | |||
c261d6cb65 | |||
fb01406738 |
10
CHANGELOG.md
10
CHANGELOG.md
@@ -6,9 +6,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
## [0.4.1] - 2024-12-04
|
## [0.5.0] - 2024-12-15
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- allow taking a local path
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- *(deps)* update rust crate serde to v1.0.216
|
||||||
|
- *(deps)* update rust crate prost to v0.13.4
|
||||||
|
|
||||||
### Other
|
### Other
|
||||||
|
- *(deps)* update rust crate clap to v4.5.23
|
||||||
- *(deps)* update all dependencies
|
- *(deps)* update all dependencies
|
||||||
- *(deps)* update rust crate tracing-subscriber to v0.3.19
|
- *(deps)* update rust crate tracing-subscriber to v0.3.19
|
||||||
- *(deps)* update rust crate tracing to v0.1.41
|
- *(deps)* update rust crate tracing to v0.1.41
|
||||||
|
32
Cargo.lock
generated
32
Cargo.lock
generated
@@ -325,9 +325,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "4.5.22"
|
version = "4.5.23"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "69371e34337c4c984bbe322360c2547210bf632eb2814bbe78a6e87a2935bd2b"
|
checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap_builder",
|
"clap_builder",
|
||||||
"clap_derive",
|
"clap_derive",
|
||||||
@@ -335,9 +335,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_builder"
|
name = "clap_builder"
|
||||||
version = "4.5.22"
|
version = "4.5.23"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6e24c1b4099818523236a8ca881d2b45db98dadfb4625cf6608c12069fcbbde1"
|
checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anstream",
|
"anstream",
|
||||||
"anstyle",
|
"anstyle",
|
||||||
@@ -359,9 +359,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_lex"
|
name = "clap_lex"
|
||||||
version = "0.7.1"
|
version = "0.7.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70"
|
checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "colorchoice"
|
name = "colorchoice"
|
||||||
@@ -1606,9 +1606,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "prost"
|
name = "prost"
|
||||||
version = "0.13.3"
|
version = "0.13.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f"
|
checksum = "2c0fef6c4230e4ccf618a35c59d7ede15dea37de8427500f50aff708806e42ec"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"prost-derive",
|
"prost-derive",
|
||||||
@@ -1622,7 +1622,7 @@ checksum = "5bb182580f71dd070f88d01ce3de9f4da5021db7115d2e1c3605a754153b77c1"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"heck",
|
"heck",
|
||||||
"itertools 0.13.0",
|
"itertools 0.12.1",
|
||||||
"log",
|
"log",
|
||||||
"multimap",
|
"multimap",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
@@ -1637,12 +1637,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "prost-derive"
|
name = "prost-derive"
|
||||||
version = "0.13.3"
|
version = "0.13.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5"
|
checksum = "157c5a9d7ea5c2ed2d9fb8f495b64759f7816c7eaea54ba3978f0d63000162e3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"itertools 0.13.0",
|
"itertools 0.12.1",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn",
|
"syn",
|
||||||
@@ -1961,18 +1961,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.215"
|
version = "1.0.216"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f"
|
checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.215"
|
version = "1.0.216"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0"
|
checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e"
|
||||||
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.4.1"
|
version = "0.5.0"
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use tonic::transport::{Channel, ClientTlsConfig};
|
use tonic::transport::{Channel, ClientTlsConfig};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@@ -14,15 +16,18 @@ pub struct State {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub enum Backend {
|
pub enum Backend {
|
||||||
Local,
|
Local { path_override: Option<PathBuf> },
|
||||||
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 => {
|
Backend::Local { path_override } => {
|
||||||
let storage = Storage::new();
|
let mut 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);
|
||||||
@@ -53,15 +58,21 @@ impl State {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn unlock(&self) {
|
pub fn unlock(&self) {
|
||||||
if let Backend::Local = &self.backend {
|
if let Backend::Local { path_override } = &self.backend {
|
||||||
let storage = Storage::new();
|
let mut 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 = &self.backend {
|
if let Backend::Local { path_override } = &self.backend {
|
||||||
let storage = Storage::new();
|
let mut storage = Storage::new();
|
||||||
|
if let Some(path_override) = path_override {
|
||||||
|
storage.with_base(path_override);
|
||||||
|
}
|
||||||
return Some(storage.info());
|
return Some(storage.info());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use clap::{Parser, Subcommand, ValueEnum};
|
use clap::{Parser, Subcommand, ValueEnum};
|
||||||
use hyperlog_tui::{
|
use hyperlog_tui::{
|
||||||
commander,
|
commander,
|
||||||
@@ -15,6 +17,9 @@ 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)]
|
||||||
@@ -90,7 +95,9 @@ 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