parser

package
v0.0.0-...-ef92b72 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package parser loads and normalizes test manifests from YAML sources.

The parser handles three syntax levels — full, compact, and one-liner — and normalizes all of them into the canonical TestFile structure.

Parser is a pure transformation layer: it does not execute tests, resolve templates, or validate plugin fields. Its sole job is producing valid manifest structures from raw bytes.

Responsibilities

  • Read files/directories and load YAML documents
  • Split multi-document YAML files
  • Detect and expand compact syntax ("POST /users": {...})
  • Detect and expand one-liner syntax ("GET /users -> 200")
  • Populate manifest.TestCase.Extra with plugin-specific fields
  • Report parse errors with line numbers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct{}

Parser loads and normalizes test manifests. A Parser is stateless and safe for concurrent use.

func New

func New() *Parser

New returns a new Parser.

func (*Parser) ParseBytes

func (p *Parser) ParseBytes(data []byte) ([]*manifest.TestFile, error)

ParseBytes parses raw YAML bytes into one or more TestFiles. Multi-document YAML is split before parsing.

func (*Parser) ParsePaths

func (p *Parser) ParsePaths(paths ...string) ([]*manifest.TestFile, error)

ParsePaths loads test files from one or more file or directory paths. Directories are walked recursively for .yaml and .yml files.

func (*Parser) ParseReader

func (p *Parser) ParseReader(r io.Reader) ([]*manifest.TestFile, error)

ParseReader reads YAML from r and parses it.

Jump to

Keyboard shortcuts

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