Skip to main content

orca_core/config/
service.rs

1use std::collections::HashMap;
2
3use serde::{Deserialize, Serialize};
4
5use crate::types::{
6    DeployStrategy, PlacementConstraint, Replicas, ResourceLimits, RuntimeKind, VolumeSpec,
7};
8
9/// Services configuration (`services.toml`).
10#[derive(Debug, Clone, Serialize, Deserialize)]
11pub struct ServicesConfig {
12    pub service: Vec<ServiceConfig>,
13}
14
15#[derive(Debug, Clone, Serialize, Deserialize)]
16pub struct ServiceConfig {
17    pub name: String,
18    #[serde(default)]
19    pub runtime: RuntimeKind,
20    /// Container image (for container runtime).
21    pub image: Option<String>,
22    /// Wasm module path or OCI reference (for wasm runtime).
23    pub module: Option<String>,
24    #[serde(default)]
25    pub replicas: Replicas,
26    pub port: Option<u16>,
27    pub domain: Option<String>,
28    pub health: Option<String>,
29    #[serde(default)]
30    pub env: HashMap<String, String>,
31    pub resources: Option<ResourceLimits>,
32    pub volume: Option<VolumeSpec>,
33    pub deploy: Option<DeployStrategy>,
34    pub placement: Option<PlacementConstraint>,
35    /// Wasm triggers: "http:/path", "cron:expr", "queue:topic", "event:pattern"
36    #[serde(default)]
37    pub triggers: Vec<String>,
38    /// Static assets directory (for builtin:static-server Wasm module).
39    pub assets: Option<String>,
40}