Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFileNotExist = errors.New("cannot find file")
ErrFileNotExist is raised when required file does not exist
View Source
var ErrUnknownExtension = errors.New("unknown extension format")
ErrUnknownExtension is raised when encountering an unknown extension
View Source
var ErrUnknownFormat = errors.New("cannot infer format from content")
ErrUnknownFormat is raised when the format cannot be guessed from the content of the file
Functions ¶
This section is empty.
Types ¶
type ConfigurationFormat ¶
type ConfigurationFormat interface { // ReadFrom the given file // implements io.ReaderFrom ReadFrom(io.Reader) (int64, error) // WriteTo a file the updated content // implements io.WriterTo WriteTo(io.Writer) (int64, 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 }
ConfigurationFormat is the common interface for all configuration parser
func Load ¶
func Load(path string) (ConfigurationFormat, error)
Load the current file and create the configuration format accordingly
Click to show internal directories.
Click to hide internal directories.