Skip to main content

rivet_envoy_client/
config.rs

1use std::{collections::HashMap, sync::Arc};
2
3// Retain the established `config::*` API while keeping implementations in their domain modules.
4pub use crate::{
5	callbacks::{ActorStopHandle, BoxFuture, EnvoyCallbacks},
6	http::{
7		HTTP_BODY_MAX_CHUNK_SIZE, HTTP_BODY_STREAM_CHANNEL_CAPACITY, HttpRequest,
8		HttpRequestBodyError, HttpRequestBodyStream, HttpResponse, HttpResponseBodyStream,
9		ResponseChunk,
10	},
11	websocket::{WebSocketHandler, WebSocketMessage, WebSocketSender},
12};
13
14pub struct EnvoyConfig {
15	pub version: u32,
16	pub endpoint: String,
17	pub token: Option<String>,
18	pub namespace: String,
19	pub pool_name: String,
20	pub prepopulate_actor_names: HashMap<String, ActorName>,
21	pub metadata: Option<serde_json::Value>,
22	/// When `start_envoy` is called, create a new envoy every time instead of using a single global envoy
23	/// instance for the entire runtime.
24	pub not_global: bool,
25
26	/// Debug option to inject artificial latency (in ms) into WebSocket communication.
27	pub debug_latency_ms: Option<u64>,
28
29	pub callbacks: Arc<dyn EnvoyCallbacks>,
30}
31
32pub struct ActorName {
33	pub metadata: serde_json::Value,
34}