Compare commits

..

10 Commits
v0.4.0 ... main

Author SHA1 Message Date
384ee78652 chore(deps): update rust crate anyhow to v1.0.95
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-23 01:39:54 +00:00
f5ca5970c1 fix(deps): update rust crate serde_json to v1.0.134
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-22 01:33:09 +00:00
6a179f0881 chore(release): v0.5.0 (#62)
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
chore(release): 0.5.0

Co-authored-by: cuddle-please <bot@cuddle.sh>
Reviewed-on: #62
2024-12-15 11:44:44 +01:00
09546907e5
feat: allow taking a local path
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-12-15 11:41:41 +01:00
83f9816cce fix(deps): update rust crate serde to v1.0.216
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-11 05:33:05 +00:00
c261d6cb65 fix(deps): update rust crate prost to v0.13.4
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-07 01:39:32 +00:00
fb01406738 chore(deps): update rust crate clap to v4.5.23
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-06 01:43:44 +00:00
352fd86145 chore(deps): update all dependencies
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-04 01:45:10 +00:00
bea5258e8f chore(deps): update rust crate tracing-subscriber to v0.3.19
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-30 02:15:38 +00:00
a0a256ac7f chore(deps): update rust crate tracing to v0.1.41
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-28 01:40:06 +00:00
5 changed files with 74 additions and 41 deletions

View File

@ -6,6 +6,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [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
- *(deps)* update rust crate clap to v4.5.23
- *(deps)* update all dependencies
- *(deps)* update rust crate tracing-subscriber to v0.3.19
- *(deps)* update rust crate tracing to v0.1.41
## [0.4.0] - 2024-11-23
### Added

64
Cargo.lock generated
View File

@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
version = 4
[[package]]
name = "addr2line"
@ -95,9 +95,9 @@ dependencies = [
[[package]]
name = "anyhow"
version = "1.0.93"
version = "1.0.95"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775"
checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04"
[[package]]
name = "async-stream"
@ -325,9 +325,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "clap"
version = "4.5.21"
version = "4.5.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f"
checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84"
dependencies = [
"clap_builder",
"clap_derive",
@ -335,9 +335,9 @@ dependencies = [
[[package]]
name = "clap_builder"
version = "4.5.21"
version = "4.5.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec"
checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838"
dependencies = [
"anstream",
"anstyle",
@ -359,9 +359,9 @@ dependencies = [
[[package]]
name = "clap_lex"
version = "0.7.1"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70"
checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
[[package]]
name = "colorchoice"
@ -1050,7 +1050,7 @@ dependencies = [
[[package]]
name = "hyperlog-protos"
version = "0.3.0"
version = "0.5.0"
dependencies = [
"prost",
"tonic",
@ -1606,9 +1606,9 @@ dependencies = [
[[package]]
name = "prost"
version = "0.13.3"
version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f"
checksum = "2c0fef6c4230e4ccf618a35c59d7ede15dea37de8427500f50aff708806e42ec"
dependencies = [
"bytes",
"prost-derive",
@ -1622,7 +1622,7 @@ checksum = "5bb182580f71dd070f88d01ce3de9f4da5021db7115d2e1c3605a754153b77c1"
dependencies = [
"bytes",
"heck",
"itertools 0.13.0",
"itertools 0.12.1",
"log",
"multimap",
"once_cell",
@ -1637,12 +1637,12 @@ dependencies = [
[[package]]
name = "prost-derive"
version = "0.13.3"
version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5"
checksum = "157c5a9d7ea5c2ed2d9fb8f495b64759f7816c7eaea54ba3978f0d63000162e3"
dependencies = [
"anyhow",
"itertools 0.13.0",
"itertools 0.12.1",
"proc-macro2",
"quote",
"syn",
@ -1961,18 +1961,18 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.215"
version = "1.0.216"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f"
checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.215"
version = "1.0.216"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0"
checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e"
dependencies = [
"proc-macro2",
"quote",
@ -1981,9 +1981,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.133"
version = "1.0.134"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377"
checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d"
dependencies = [
"itoa",
"memchr",
@ -2552,9 +2552,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
version = "1.41.1"
version = "1.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33"
checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551"
dependencies = [
"backtrace",
"bytes",
@ -2761,9 +2761,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
[[package]]
name = "tracing"
version = "0.1.40"
version = "0.1.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
dependencies = [
"log",
"pin-project-lite",
@ -2773,9 +2773,9 @@ dependencies = [
[[package]]
name = "tracing-attributes"
version = "0.1.27"
version = "0.1.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d"
dependencies = [
"proc-macro2",
"quote",
@ -2784,9 +2784,9 @@ dependencies = [
[[package]]
name = "tracing-core"
version = "0.1.32"
version = "0.1.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54"
checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c"
dependencies = [
"once_cell",
"valuable",
@ -2805,9 +2805,9 @@ dependencies = [
[[package]]
name = "tracing-subscriber"
version = "0.3.18"
version = "0.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b"
checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008"
dependencies = [
"matchers",
"nu-ansi-term",

View File

@ -26,4 +26,4 @@ hex = { version = "0.4.3" }
toml = { version = "0.8.14" }
[workspace.package]
version = "0.4.0"
version = "0.5.0"

View File

@ -1,3 +1,5 @@
use std::path::PathBuf;
use tonic::transport::{Channel, ClientTlsConfig};
use crate::{
@ -14,15 +16,18 @@ pub struct State {
}
pub enum Backend {
Local,
Local { path_override: Option<PathBuf> },
Remote { url: String },
}
impl State {
pub async fn new(backend: Backend) -> anyhow::Result<Self> {
let (querier, commander) = match &backend {
Backend::Local => {
let storage = Storage::new();
Backend::Local { path_override } => {
let mut storage = Storage::new();
if let Some(path_override) = path_override {
storage.with_base(path_override);
}
let engine = storage.load()?;
let events = Events::default();
let engine = SharedEngine::from(engine);
@ -53,15 +58,21 @@ impl State {
}
pub fn unlock(&self) {
if let Backend::Local = &self.backend {
let storage = Storage::new();
if let Backend::Local { path_override } = &self.backend {
let mut storage = Storage::new();
if let Some(path_override) = path_override {
storage.with_base(path_override);
}
storage.clear_lock_file();
}
}
pub fn info(&self) -> Option<anyhow::Result<String>> {
if let Backend::Local = &self.backend {
let storage = Storage::new();
if let Backend::Local { path_override } = &self.backend {
let mut storage = Storage::new();
if let Some(path_override) = path_override {
storage.with_base(path_override);
}
return Some(storage.info());
}

View File

@ -1,3 +1,5 @@
use std::path::PathBuf;
use clap::{Parser, Subcommand, ValueEnum};
use hyperlog_tui::{
commander,
@ -15,6 +17,9 @@ struct Command {
#[arg(long = "backend-url", required_if_eq("backend", "remote"))]
backend_url: Option<String>,
#[arg(long = "local-path")]
local_path: Option<PathBuf>,
}
#[derive(ValueEnum, Clone)]
@ -90,7 +95,9 @@ pub async fn execute() -> anyhow::Result<()> {
let backend_url = cli.backend_url;
let backend = match backend {
BackendArg::Local => Backend::Local,
BackendArg::Local => Backend::Local {
path_override: cli.local_path.clone(),
},
BackendArg::Remote => Backend::Remote {
url: backend_url.expect("backend-url to be set"),
},