cnf

package
v0.0.0-...-5998bd7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2019 License: MIT Imports: 11 Imported by: 0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL