Discover Packages
github.com/rest-sh/restish/v2
internal
filter
package
Version:
v2.1.0
Opens a new window with list of versions in this module.
Published: May 29, 2026
License: MIT
Opens a new window with license information.
Imports: 11
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package filter applies shorthand or jq expressions to a response value.
Apply runs expr against doc using the chosen language and returns the result.
doc should be a map[string]any with keys "body", "headers", "headers_all",
"links", "status", "proto" — i.e. the full normalised Response map.
Lang selects which query language to use.
const (
LangAuto Lang = iota
LangShorthand
LangJQ
)
type Result struct {
Value any
Lang Lang
}
Result is a filtered value with metadata about how the filter was evaluated.
ApplyWithInfo runs expr against doc and returns the filtered value plus the
language that was ultimately used.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.