jsonprobe

package
v0.1.0-rc.1 Latest Latest
Warning

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

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

Documentation

Overview

Package jsonprobe inspects JSON request bodies for reference backend servers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasJSONBool

func HasJSONBool(body []byte, key string, want bool) bool

HasJSONBool reports whether a request contains an exact boolean key/value.

func HasJSONKey

func HasJSONKey(body []byte, key string) bool

HasJSONKey reports whether a request contains a key at any JSON object depth. It deliberately ignores quoted text and malformed payloads.

func HasJSONNumber

func HasJSONNumber(body []byte, key string, want float64) bool

HasJSONNumber reports whether a request contains an exact numeric key/value pair at any JSON object depth. It prevents fixture controls from matching user text or quoted numeric values.

func TryWriteForcedHTTPError

func TryWriteForcedHTTPError(w http.ResponseWriter, status int, retryAfter string, body string, defaultBody func(int) string) bool

TryWriteForcedHTTPError writes a forced HTTP error if status is non-zero. If it returns true, the caller should return and stop processing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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