create common configuration format interface
This commit is contained in:
parent
1c2cdaf641
commit
aa609561d5
|
@ -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
|
||||
}
|
Loading…
Reference in New Issue