pub struct ServiceDef {
pub service: ServiceMeta,
pub requirements: Option<Requirements>,
pub ports: Vec<PortDef>,
pub env: Vec<EnvVar>,
pub env_groups: Vec<EnvGroup>,
pub choices: Vec<Choice>,
pub requires: Vec<ServiceRequirement>,
pub mappings: Mappings,
pub integrations: IntegrationFlags,
pub capabilities: Capabilities,
pub backup: Option<BackupConfig>,
pub metrics: Option<MetricsDef>,
}Expand description
A service definition from a registry’s services/<name>/service.toml.
Fields§
§service: ServiceMeta§requirements: Option<Requirements>§ports: Vec<PortDef>§env: Vec<EnvVar>§env_groups: Vec<EnvGroup>Optional, user-toggled bundles of env vars. A group is either fully
enabled (every member lands in .env) or fully disabled (none do) —
makes “client_id without client_secret” unrepresentable.
choices: Vec<Choice>Mutually-exclusive choices. Exactly one option per choice is selected
and only that option’s env vars are written, so “none selected” and
“two at once” are unrepresentable rather than rejected. The sum type
to env_group’s product.
requires: Vec<ServiceRequirement>§mappings: Mappings§integrations: IntegrationFlags§capabilities: CapabilitiesRoles this service can play for other services. The dual of
IntegrationFlags (which describes what this service consumes).
Drives capability-based dispatch — see crate::capability.
backup: Option<BackupConfig>Backup configuration. Present only when the author has declared
backup = true in [integrations] and the service needs more
than the default “back up everything classified as data.”
Carries hooks (pre/post dump) and exclude lists.
metrics: Option<MetricsDef>Prometheus-style metrics endpoint this service exposes. When set and a metrics-store provider is installed, ryra writes a file_sd scrape target and joins the service to the store’s network.
Implementations§
Source§impl ServiceDef
impl ServiceDef
Sourcepub fn check_architecture(&self) -> Option<String>
pub fn check_architecture(&self) -> Option<String>
Check if this service supports the current system architecture. Returns None if supported (or no restriction), Some(error) if not.
Sourcepub fn required_env_vars(&self) -> Vec<&str>
pub fn required_env_vars(&self) -> Vec<&str>
Returns env var names that are required — must be provided during install.
Trait Implementations§
Source§impl Clone for ServiceDef
impl Clone for ServiceDef
Source§fn clone(&self) -> ServiceDef
fn clone(&self) -> ServiceDef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more