Skip to content

Commit 4cdcc3d

Browse files
authored
serve both servers with shared instance (#58)
1 parent 2af1d32 commit 4cdcc3d

File tree

32 files changed

+521
-448
lines changed

32 files changed

+521
-448
lines changed

.env.example

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
1-
NUMBER_OF_DATABASE=3
2-
DATABASE_PATH1=Enter-path-1-here
3-
DATABASE_NAME1=Enter-name-1-here
4-
DATABASE_PATH2=Enter-path-2-here
5-
DATABASE_NAME2=Enter-name-2-here
6-
DATABASE_PATH3=Enter-path-3-here
7-
DATABASE_NAME3=Enter-name-3-here
1+
# HTTP Server
2+
HTTP_HOST=127.0.0.1
3+
HTTP_PORT=3000
84

5+
# gRPC Server
6+
GRPC_HOST=127.0.0.1
7+
GRPC_PORT=50051
8+
# required
9+
GRPC_ROOT_PASSWORD=your-secure-password
10+
11+
# Database Configuration
12+
# Storage: inmemory, rocksdb
13+
# Index: flat, kdtree, hnsw
14+
STORAGE_TYPE=rocksdb
15+
INDEX_TYPE=flat
16+
DIMENSION=512
17+
18+
DATA_PATH=./data
19+
20+
# Server Options
21+
LOGGING=true
22+
DISABLE_HTTP=false
23+
24+
# Embedding Services (TUI)
925
TEXT_EMBEDDING_URL=http://localhost:8080/vectors
1026
IMAGE_EMBEDDING_URL=http://localhost:8080/vectors_img

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
/data/
77
.TODO
88
/databases
9+
.env

Cargo.lock

Lines changed: 53 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ members = [
55
"crates/storage",
66
"crates/index",
77
"crates/server",
8-
"crates/http_server",
8+
"crates/http",
99
"crates/tui",
10-
"crates/grpc_server",
10+
"crates/grpc",
1111
]
1212

1313
# You can define shared dependencies for all crates here

crates/api/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ impl VectorDb {
131131
}
132132
}
133133

134+
#[derive(Debug)]
134135
pub struct DbConfig {
135136
pub storage_type: StorageType,
136137
pub index_type: IndexType,

crates/defs/src/error.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@ impl std::fmt::Display for DbError {
2929
}
3030

3131
impl std::error::Error for DbError {}
32+
33+
// Error type for server
34+
pub type BoxError = Box<dyn std::error::Error + Send + Sync>;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "grpc_server"
2+
name = "grpc"
33
version = "0.1.0"
44
edition = "2024"
55

File renamed without changes.

0 commit comments

Comments
 (0)