diff options
author | John Estabrook <jestabro@vyos.io> | 2023-05-16 12:47:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-16 12:47:05 -0500 |
commit | cd4d75828efc51f42a53966ad7d85e4f0500b089 (patch) | |
tree | c2eee56088494501dc8a938a60eb8f61207e5181 /src/reference_tree.mli | |
parent | ceed15b2b064b36c0f49d2142ebe0dafeaa34267 (diff) | |
parent | ea2105a95dc1d821a933a6a441f5efc39779a624 (diff) | |
download | vyos1x-config-cd4d75828efc51f42a53966ad7d85e4f0500b089.tar.gz vyos1x-config-cd4d75828efc51f42a53966ad7d85e4f0500b089.zip |
Merge pull request #17 from jestabro/reference-tree
T5194: add support for reference tree
Diffstat (limited to 'src/reference_tree.mli')
-rw-r--r-- | src/reference_tree.mli | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/reference_tree.mli b/src/reference_tree.mli new file mode 100644 index 0000000..0e70ff5 --- /dev/null +++ b/src/reference_tree.mli @@ -0,0 +1,65 @@ +type node_type = + | Leaf + | Tag + | Other + +type value_constraint = + | Regex of string [@name "regex"] + | External of string * string option [@name "exec"] + [@@deriving yojson] + +type completion_help_type = + | List of string [@name "list"] + | Path of string [@name "path"] + | Script of string [@name "script"] + [@@deriving to_yojson] + +type ref_node_data = { + node_type: node_type; + constraints: value_constraint list; + constraint_error_message: string; + completion_help: completion_help_type list; + help: string; + value_help: (string * string) list; + multi: bool; + valueless: bool; + owner: string option; + priority: string option; + default_value: string option; + hidden: bool; + secret: bool; +} [@@deriving to_yojson] + +type t = ref_node_data Vytree.t [@@deriving to_yojson] + +exception Bad_interface_definition of string + +exception Validation_error of string + +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_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 + +val render_json : t -> string |