body

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 5 Imported by: ? 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

Overview

Package body parses and composes the request body for write operations.

Two baseline sources (mutually exclusive), then field-flag overlay:

  1. --file <path> baseline JSON read from a file ("-" = stdin)
  2. --json <inline> baseline JSON given inline on the command line
  3. --<field> / --<a>.<b> structured field flags overlay on top of the baseline

The result is a Go value ready to hand off to the HTTP client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compose

func Compose(baseline interface{}, fields map[string]string) (interface{}, error)

Compose merges baseline (from --file/--json) with structured field flags. Field flag values override baseline fields at matching dot-paths. Field values are JSON-parsed when possible (numbers, booleans, arrays, objects) so callers can pass typed scalars; otherwise the value is treated as a string.

Returns nil when the resulting body is empty (no baseline, no flags).

func Parse

func Parse(file, inline string) (interface{}, error)

Parse converts the --file or --json argument into a Go value. Exactly one of `file` and `inline` may be non-empty (caller validates). Both empty → returns nil (caller may still merge field flags).

Types

This section is empty.

Jump to

Keyboard shortcuts

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