configfile

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrFileNotFound signals a config file not found.
	ErrFileNotFound = errors.New("file not found")

	// ErrFileRead signals an error trying to read a config file.
	// It can be due to a corrupted file or an invalid permission
	// for instance.
	ErrFileRead = errors.New("invalid file")

	// ErrFileExt signals an unsupported extension for the config file.
	ErrFileExt = errors.New("invalid extension")

	// ErrParse signals an error parsing a retrieved config file.
	// It is returned if it contains an unexpected field or an unexpected
	// value for a field.
	ErrParse = errors.New("parsing error: invalid config file")

	// ErrCircularExtends signals a circular reference in the config file.
	ErrCircularExtends = errors.New("circular reference detected")
)

Functions

func Find

func Find(names []string) string

Find returns the first name tham matches a file path. If no match is found, it returns an empty string.

func Parse

func Parse(filename string) (cfg config.Global, err error)

Parse parses a benchttp runner config file into a config.Global and returns it or the first non-nil error occurring in the process, which can be any of the values declared in the package.

Types

This section is empty.

Jump to

Keyboard shortcuts

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