Expose create_redis_value through the Tauri bridge, add NX-based string creation in redis-core, and surface duplicate-key handling through stable operator notices. Co-Authored-By: Paperclip <noreply@paperclip.ing>
47 lines
1.8 KiB
Rust
47 lines
1.8 KiB
Rust
mod bootstrap;
|
|
mod connection;
|
|
mod error;
|
|
mod service;
|
|
|
|
pub use bootstrap::{BackendBootstrap, EntrySurface, PersistenceBoundary, SecretHandling};
|
|
pub use connection::{
|
|
CommandExecutionResult, ConnectionProfileDraft, ConnectionTarget, ConnectionTestResult,
|
|
RedisCommandRequest, RedisConnectionRequest, RedisFieldValueEntry, RedisKeyBrowseRequest,
|
|
RedisKeyBrowseResult, RedisKeyMetadata, RedisKeyMetadataRequest, RedisKeyTtl,
|
|
RedisKeyTtlUpdate, RedisKeyTtlUpdateRequest, RedisKeyTtlUpdateResult, RedisResponse,
|
|
RedisSortedSetEntry, RedisStreamEntry, RedisValueContent, RedisValueCreateInput,
|
|
RedisValueCreateRequest, RedisValueCreateResult, RedisValueData, RedisValueReadRequest,
|
|
RedisValueRecord, RedisValueWriteCapability, RedisValueWriteInput, RedisValueWriteRequest,
|
|
TlsMode,
|
|
};
|
|
pub use error::{BackendError, BackendErrorCode};
|
|
pub use service::{
|
|
browse_keys, create_value, execute_command, inspect_key, read_value, test_connection,
|
|
update_key_ttl, write_value,
|
|
};
|
|
|
|
#[cfg(test)]
|
|
mod tests {
|
|
use crate::{BackendBootstrap, ConnectionTarget, TlsMode};
|
|
|
|
#[test]
|
|
fn desktop_bootstrap_keeps_persistence_guardrails_stable() {
|
|
let bootstrap = BackendBootstrap::for_desktop();
|
|
|
|
assert_eq!(bootstrap.persistence.connection_catalog, "not_configured");
|
|
assert_eq!(bootstrap.persistence.secrets, "memory_only");
|
|
assert_eq!(bootstrap.command_execution, "single_instance_enabled");
|
|
assert_eq!(bootstrap.key_browsing, "scan_metadata_enabled");
|
|
}
|
|
|
|
#[test]
|
|
fn connection_target_defaults_match_local_redis_expectation() {
|
|
let target = ConnectionTarget::default();
|
|
|
|
assert_eq!(target.host, "127.0.0.1");
|
|
assert_eq!(target.port, 6379);
|
|
assert_eq!(target.database, 0);
|
|
assert_eq!(target.tls_mode, TlsMode::Disabled);
|
|
}
|
|
}
|