ffyaml

package
v3.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 5 Imported by: 11

Documentation

Overview

Package ffyaml provides a YAML config file parser.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parser

func Parser(r io.Reader, set func(name, value string) error) error

Parser is a helper function that uses a default ParseConfig.

Types

type ParseConfig added in v3.4.0

type ParseConfig struct {
	// Delimiter is used when concatenating nested node keys into a flag name.
	// The default delimiter is ".".
	Delimiter string
}

ParseConfig collects parameters for the YAML config file parser.

func (*ParseConfig) Parse added in v3.4.0

func (pc *ParseConfig) Parse(r io.Reader, set func(name, value string) error) error

Parse a YAML document from the provided io.Reader, using the provided set function to set flag values. Flag names are derived from the node names and their key/value pairs.

type ParseError

type ParseError struct {
	Inner error
}

ParseError wraps all errors originating from the YAML parser.

func (ParseError) Error

func (e ParseError) Error() string

Error implenents the error interface.

func (ParseError) Unwrap

func (e ParseError) Unwrap() error

Unwrap implements the errors.Wrapper interface, allowing errors.Is and errors.As to work with ParseErrors.

Jump to

Keyboard shortcuts

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