platform.mojo (977B)
1 from hyf_runtime.errors import raise_runtime_contract_error 2 from hyf_runtime.namespace import join_runtime_path 3 4 5 def _require_non_empty_path(path: String, context: String) raises -> String: 6 var trimmed = String(String(path).strip()) 7 if trimmed == "": 8 raise_runtime_contract_error(context + " must not be empty") 9 return trimmed^ 10 11 12 def interactive_user_base_root(user_home: String) raises -> String: 13 return join_runtime_path( 14 _require_non_empty_path(user_home, "interactive_user home"), ".radroots" 15 ) 16 17 18 def service_host_config_root() -> String: 19 return "/etc/radroots" 20 21 22 def service_host_data_root() -> String: 23 return "/var/lib/radroots" 24 25 26 def service_host_cache_root() -> String: 27 return "/var/cache/radroots" 28 29 30 def service_host_logs_root() -> String: 31 return "/var/log/radroots" 32 33 34 def service_host_run_root() -> String: 35 return "/run/radroots" 36 37 38 def service_host_secrets_root() -> String: 39 return "/etc/radroots/secrets"