pub struct DaemonConfig {
pub host: String,
pub port: u16,
pub grpc_port: u16,
pub data_directory: String,
pub storage_backend: String,
pub surrealdb_endpoint: Option<String>,
pub surrealdb_username: Option<String>,
pub surrealdb_password: Option<String>,
pub surrealdb_namespace: String,
pub surrealdb_database: String,
}Expand description
Daemon configuration loaded from file and environment
Fields§
§host: StringHost to bind to (default: 127.0.0.1)
port: u16Port to listen on (default: 3737)
grpc_port: u16gRPC port (default: 3738, 0 = disabled)
data_directory: StringData directory for RocksDB (default: ~/.post-cortex/data)
storage_backend: StringStorage backend: “rocksdb” or “surrealdb” (default: rocksdb)
surrealdb_endpoint: Option<String>SurrealDB endpoint (required if storage_backend = “surrealdb”) Example: “ws://localhost:8000”
surrealdb_username: Option<String>SurrealDB username (optional)
surrealdb_password: Option<String>SurrealDB password (optional)
surrealdb_namespace: StringSurrealDB namespace (default: “post_cortex”)
surrealdb_database: StringSurrealDB database (default: “main”)
Implementations§
Source§impl DaemonConfig
impl DaemonConfig
Sourcepub fn load() -> DaemonConfig
pub fn load() -> DaemonConfig
Load configuration from file with environment variable overrides
Priority order:
- Environment variables (PC_HOST, PC_PORT, PC_DATA_DIR)
- Config file (~/.post-cortex/daemon.toml)
- Default values
Sourcepub fn create_example_config() -> Result<PathBuf, String>
pub fn create_example_config() -> Result<PathBuf, String>
Create example config file at the default location
Returns path to created file or error message
Trait Implementations§
Source§impl Clone for DaemonConfig
impl Clone for DaemonConfig
Source§fn clone(&self) -> DaemonConfig
fn clone(&self) -> DaemonConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DaemonConfig
impl Debug for DaemonConfig
Source§impl Default for DaemonConfig
impl Default for DaemonConfig
Source§fn default() -> DaemonConfig
fn default() -> DaemonConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DaemonConfig
impl<'de> Deserialize<'de> for DaemonConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DaemonConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DaemonConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for DaemonConfig
impl Serialize for DaemonConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for DaemonConfig
impl RefUnwindSafe for DaemonConfig
impl Send for DaemonConfig
impl Sync for DaemonConfig
impl Unpin for DaemonConfig
impl UnsafeUnpin for DaemonConfig
impl UnwindSafe for DaemonConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request