parser

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(r io.Reader) ([]types.Definition, error)

All receives a reader from a definition file and parses it into a slice of Definition structs or returns error if an error is encounter while parsing

func GetLabels

func GetLabels(content string) map[string]string

func IsInvalidSectionError

func IsInvalidSectionError(err error) bool

IsInvalidSectionError returns a boolean indicating whether the error is reporting if a section of the definition is not a standard section

func IsValidDefinition

func IsValidDefinition(source string) (valid bool, err error)

IsValidDefinition returns whether or not the given file is a valid definition

func ParseDefinitionFile

func ParseDefinitionFile(r io.Reader) (d types.Definition, err error)

ParseDefinitionFile receives a reader from a definition file and parse it into a Definition struct or return error if the definition file has a bad section.

Types

type InvalidSectionError

type InvalidSectionError struct {
	Sections []string
	Err      error
}

InvalidSectionError records an error and the sections that caused it.

func (*InvalidSectionError) Error

func (e *InvalidSectionError) Error() string

Jump to

Keyboard shortcuts

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