diff --git a/cnf/common.go b/cnf/common.go new file mode 100644 index 0000000..bf1b6b2 --- /dev/null +++ b/cnf/common.go @@ -0,0 +1,20 @@ +package cnf + +// Field generic representation (root, branch or leaf) +type Field struct { + // Label of the current field + Label string + // Value of the current field + Value string + // Children of the current field or NIL if none + Children []Field +} + +// ConfigurationFormat is the common interface for all configuration parser +type ConfigurationFormat interface { + // Get the value of a field if it exists + Get(string) (string, bool) + + // Set the value of a field if exists + Set(string, string) bool +}