Files
ngit-grasp/Cargo.toml
T
DanConwayDev 5bd6b9b93c Add SyncContext trait and MockSyncContext for purgatory sync
Implement the abstraction layer for purgatory sync operations:

- SyncContext trait: defines interface for repository data fetching,
  OID existence checks, git fetch operations, and event processing
- ProcessResult: captures outcomes when releasing events from purgatory
- MockSyncContext: test mock with builder pattern for configuring:
  - Clone URLs and which OIDs each URL provides
  - Needed OIDs (simulates purgatory state)
  - URL failure simulation
  - Fetch logging for assertions

The trait uses async_trait for async method support and requires
Send + Sync for use in concurrent sync operations.

This abstraction enables unit testing of sync logic without I/O,
while the real implementation (to be added later) will connect
to actual database, git, and relay systems.
2026-01-07 11:40:41 +00:00

82 lines
1.8 KiB
TOML

[package]
name = "ngit-grasp"
version = "0.1.0"
edition = "2021"
authors = ["ngit-grasp contributors"]
license = "MIT"
description = "A GRASP (Git Relays Authorized via Signed-Nostr Proofs) implementation in Rust"
repository = "https://gitworkshop.dev/ngit-grasp"
[dependencies]
# Async runtime
tokio = { version = "1.35", features = ["full"] }
# HTTP server (hyper for relay integration)
hyper = { version = "1.4", features = ["full"] }
hyper-util = { version = "0.1", features = ["tokio", "server", "http1", "http2"] }
http-body-util = "0.1"
# Nostr relay
nostr-relay-builder = { git = "https://github.com/rust-nostr/nostr", rev = "e09c9d82a1778683d2a6b968d09eb2c619883bf3" }
# Nostr
nostr-sdk = { git = "https://github.com/rust-nostr/nostr", rev = "e09c9d82a1778683d2a6b968d09eb2c619883bf3" }
nostr-lmdb = { git = "https://github.com/rust-nostr/nostr", rev = "e09c9d82a1778683d2a6b968d09eb2c619883bf3" }
# Utilities
futures-util = "0.3"
base64 = "0.22"
flate2 = "1.0"
# Metrics
prometheus = "0.13"
dashmap = "5"
lazy_static = "1.4"
# Data structures
indexmap = "2"
# Random (for startup jitter)
rand = "0.8"
# Serialization
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
# Logging
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
# Configuration
dotenvy = "0.15"
clap = { version = "4.5", features = ["derive", "env"] }
# Error handling
anyhow = "1.0"
thiserror = "1.0"
# Async traits
async-trait = "0.1"
# Git (for future use)
# git-http-backend = "0.3"
[dev-dependencies]
# Testing
tokio-test = "0.4"
grasp-audit = { path = "grasp-audit" }
url = "2.5"
tempfile = "3"
reqwest = "0.12"
[lib]
name = "ngit_grasp"
path = "src/lib.rs"
[[bin]]
name = "ngit-grasp"
path = "src/main.rs"
[workspace]
members = [".", "grasp-audit"]