summaryrefslogtreecommitdiff
path: root/src/reference_tree.mli
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-05-01 11:02:04 -0500
committerJohn Estabrook <jestabro@vyos.io>2023-05-10 22:52:25 -0500
commita7edc77977f054112341d5eb2b2e1903239e3fec (patch)
tree039a553e78adbfe73cc36803d9e2afd7ecaac932 /src/reference_tree.mli
parentceed15b2b064b36c0f49d2142ebe0dafeaa34267 (diff)
downloadvyos1x-config-a7edc77977f054112341d5eb2b2e1903239e3fec.tar.gz
vyos1x-config-a7edc77977f054112341d5eb2b2e1903239e3fec.zip
T5194: import reference_tree from vyconf
Diffstat (limited to 'src/reference_tree.mli')
-rw-r--r--src/reference_tree.mli54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/reference_tree.mli b/src/reference_tree.mli
new file mode 100644
index 0000000..eab9fe9
--- /dev/null
+++ b/src/reference_tree.mli
@@ -0,0 +1,54 @@
+type node_type = Leaf | Tag | Other
+
+type value_constraint =
+ | Regex of string [@name "regex"]
+ | External of string * string option [@name "exec"]
+ [@@deriving yojson]
+
+type ref_node_data = {
+ node_type: node_type;
+ constraints: value_constraint list;
+ help: string;
+ value_help: (string * string) list;
+ constraint_error_message: string;
+ multi: bool;
+ valueless: bool;
+ owner: string option;
+ keep_order: bool;
+ hidden: bool;
+ secret: bool;
+}
+
+exception Bad_interface_definition of string
+
+exception Validation_error of string
+
+type t = ref_node_data Vytree.t
+
+val default_data : ref_node_data
+
+val default : t
+
+val load_from_xml : t -> string -> t
+
+val is_multi : t -> string list -> bool
+
+val is_hidden : t -> string list -> bool
+
+val is_secret : t -> string list -> bool
+
+val is_tag : t -> string list -> bool
+
+val is_leaf : t -> string list -> bool
+
+val is_valueless : t -> string list -> bool
+
+val get_keep_order : t -> string list -> bool
+
+val get_owner : t -> string list -> string option
+
+val get_help_string : t -> string list -> string
+
+val get_value_help : t -> string list -> (string * string) list
+
+val get_completion_data : t -> string list -> (node_type * bool * string) list