File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: PMPL-1.0-or-later
2+ // Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
3+ //
4+ // Conflow V-lang API — Configuration orchestration client.
5+ module conflow
6+
7+ pub enum ConfigFormat {
8+ nickel
9+ toml
10+ json
11+ yaml
12+ }
13+
14+ pub enum ApplyResult {
15+ applied
16+ no_change
17+ conflict
18+ @error
19+ }
20+
21+ pub struct ConfigEntry {
22+ pub :
23+ key string
24+ value string
25+ format ConfigFormat
26+ }
27+
28+ fn C.conflow_validate_config (config_ptr & u8 , format int ) int
29+ fn C.conflow_valid_format (format int ) int
30+
31+ // validate checks if a configuration string is valid for the given format.
32+ pub fn validate (config string , format ConfigFormat) bool {
33+ return C.conflow_validate_config (config.str, int (format)) == 0
34+ }
35+
36+ // is_valid_format checks if a format ID is supported.
37+ pub fn is_valid_format (format ConfigFormat) bool {
38+ return C.conflow_valid_format (int (format)) == 1
39+ }
You can’t perform that action at this time.
0 commit comments