bodyref

package
v0.36.2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(line string, opt Options) (string, bool)

Parse returns the body file path from Resterm's "< path" body reference syntax. Options controls where to look for "<" and whether body file references are disabled for the current body.

func ParseBodyFile added in v0.33.3

func ParseBodyFile(line string, forceInline bool) (string, bool)

ParseBodyFile returns a body file path from a protocol body line. It accepts standalone "< path" references and directive-style "@name < path" references.

Types

type Location

type Location int
const (
	// Line parses a standalone body reference line, e.g. "< ./payload.json".
	Line Location = iota
	// Inline parses a body reference embedded in an at-prefixed line, e.g. "@query < ./query.graphql".
	Inline
)

type Options

type Options struct {
	Location Location
	// ForceInline disables body file references for ambiguous literal bodies.
	ForceInline bool
}

Jump to

Keyboard shortcuts

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