bodyref

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IncludeLine added in v0.45.2

func IncludeLine(line string) (string, bool)

IncludeLine returns the file path from an "@path" body include line. "@{...}" template markers are not includes.

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