create common configuration format interface

This commit is contained in:
xdrm-brackets 2018-11-06 18:01:36 +01:00
parent 1c2cdaf641
commit aa609561d5
1 changed files with 20 additions and 0 deletions

20
cnf/common.go Normal file
View File

@ -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
}