nix-amer/internal/cnf/common.go

28 lines
567 B
Go

package cnf
import (
"io"
)
// 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 {
// Parse the given file
Parse(io.Reader) error
// 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
}